Skip to content

Commit 71cbb1a

Browse files
authored
Fix one flakiness issue in browser.test_chunked_synchronous_xhr (#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.
1 parent 9602b80 commit 71cbb1a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tests/checksummer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ int main(int argc, char* argv[]) {
3131
long bufsize;
3232

3333
if (argc != 2) {
34-
fputs("Need 1 argument\n", stderr);
35-
return (EXIT_FAILURE);
34+
fputs("Need 1 argument\n", stderr);
35+
return (EXIT_FAILURE);
3636
}
3737

3838
unsigned char *source = NULL;

tests/test_browser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,8 +1685,10 @@ def test_chunked_synchronous_xhr(self):
16851685

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

0 commit comments

Comments
 (0)