diff --git a/tests/cmu-sod/Makefile b/tests/cmu-sod/Makefile index b212664..c8d9b1a 100644 --- a/tests/cmu-sod/Makefile +++ b/tests/cmu-sod/Makefile @@ -8,10 +8,10 @@ clean: rm -rf res/* run: - SLEDGE_SANDBOX_PERF_LOG=perf.log LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json + SLEDGE_SPINLOOP_PAUSE_ENABLED=true SLEDGE_SANDBOX_PERF_LOG=perf.log LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json debug: - SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json" + SLEDGE_SPINLOOP_PAUSE_ENABLED=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json" valgrind: SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} valgrind --leak-check=full --max-stackframe=11150456 --run-libc-freeres=no --run-cxx-freeres=no ${SLEDGE_BINARY_DIR}/sledgert spec.json diff --git a/tests/cmu-sod/test_requests.py b/tests/cmu-sod/test_requests.py new file mode 100644 index 0000000..c74b328 --- /dev/null +++ b/tests/cmu-sod/test_requests.py @@ -0,0 +1,20 @@ +import time +import requests + +url = 'http://arena0.andrew.cmu.edu:10000/depth_to_xyz' + +payload = open('0_depth.png', 'rb') + +img = None + +response = requests.post(url, data=payload) +img = response.content +time.sleep(1) +print("single request works!") + +for i in range(100): + payload = open('0_depth.png', 'rb') + response = requests.post(url, data=payload) + img = response.content + time.sleep(1) + print(f"multi request #{i} works!") diff --git a/tests/cmu-sod/edward.py b/tests/cmu-sod/test_threads.py similarity index 97% rename from tests/cmu-sod/edward.py rename to tests/cmu-sod/test_threads.py index c36f135..3c7f5a3 100644 --- a/tests/cmu-sod/edward.py +++ b/tests/cmu-sod/test_threads.py @@ -28,5 +28,4 @@ def get_img(): thread = threading.Thread(target=get_img) thread.daemon = True thread.start() - - +thread.join()