Skip to content

Commit

Permalink
Fix one flakiness issue in browser.test_chunked_synchronous_xhr (emsc…
Browse files Browse the repository at this point in the history
…ripten-core#9003)

The test is marked @flaky which runs it up to 3 times to try to avoid a random error. But we never shut down the server, so the second and later runs would just hit an error on trying to create a server on the same port. (Of course not shutting down the server was bad for other reasons too!)

Hopefully this will decrease dramatically the number of random failures on this test, but it won't eliminate them entirely.
  • Loading branch information
kripken authored and belraquib committed Dec 23, 2020
1 parent d6bb4c2 commit 845ee39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/checksummer.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ int main(int argc, char* argv[]) {
long bufsize;

if (argc != 2) {
fputs("Need 1 argument\n", stderr);
return (EXIT_FAILURE);
fputs("Need 1 argument\n", stderr);
return (EXIT_FAILURE);
}

unsigned char *source = NULL;
Expand Down
6 changes: 4 additions & 2 deletions tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1685,8 +1685,10 @@ def test_chunked_synchronous_xhr(self):

server = multiprocessing.Process(target=test_chunked_synchronous_xhr_server, args=(True, chunkSize, data, checksum, self.port))
server.start()
self.run_browser(main, 'Chunked binary synchronous XHR in Web Workers!', '/report_result?' + str(checksum))
server.terminate()
try:
self.run_browser(main, 'Chunked binary synchronous XHR in Web Workers!', '/report_result?' + str(checksum))
finally:
server.terminate()
# Avoid race condition on cleanup, wait a bit so that processes have released file locks so that test tearDown won't
# attempt to rmdir() files in use.
if WINDOWS:
Expand Down

0 comments on commit 845ee39

Please sign in to comment.