Skip to content

Commit

Permalink
update cmu-sod tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emil916 committed Oct 6, 2022
1 parent dac95d0 commit bc2c521
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/cmu-sod/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions tests/cmu-sod/test_requests.py
Original file line number Diff line number Diff line change
@@ -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!")
3 changes: 1 addition & 2 deletions tests/cmu-sod/edward.py → tests/cmu-sod/test_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ def get_img():
thread = threading.Thread(target=get_img)
thread.daemon = True
thread.start()


thread.join()

0 comments on commit bc2c521

Please sign in to comment.