Skip to content

Commit

Permalink
fix: Add check to fail the benchmark test on server error (denoland#4519
Browse files Browse the repository at this point in the history
)
  • Loading branch information
avillega committed Mar 30, 2020
1 parent 4b71ac5 commit 3892d49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/http_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ def run(server_cmd, port, merge_env=None, origin_cmd=None):
print output
return stats
finally:
server_retcode = server.poll()
if server_retcode is not None and server_retcode != 0:
print "server ended with error"
sys.exit(1)
server.kill()
if origin is not None:
origin.kill()
Expand Down
3 changes: 3 additions & 0 deletions tools/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ def spawn():
yield servers
finally:
for s in servers:
# Make sure all servers still running,
# if not assume there was an error
assert s.thread.is_alive()
s.server.shutdown()


Expand Down

0 comments on commit 3892d49

Please sign in to comment.