@@ -7510,16 +7510,29 @@ async def test_wait_for_workers_updates_info(c, s):
75107510
75117511
75127512@pytest .mark .slow
7513+ @pytest .mark .flaky (reruns = 5 , rerun_delay = 10 , only_rerun = "Found blocklist match" )
75137514@pytest .mark .parametrize ("processes" , [True , False ])
75147515def test_quiet_close_process (processes , tmp_path ):
75157516 with open (tmp_path / "script.py" , mode = "w" ) as f :
75167517 f .write (client_script % processes )
75177518
75187519 with popen ([sys .executable , tmp_path / "script.py" ], capture_output = True ) as proc :
7519- out , err = proc .communicate (timeout = 60 )
7520+ out , _ = proc .communicate (timeout = 60 )
75207521
7521- assert not out
7522- assert not err
7522+ lines = out .decode ("utf-8" ).split ("\n " )
7523+ lines = [stripped for line in lines if (stripped := line .strip ())]
7524+
7525+ # List of frequent spurious messages that are beyond the scope of this test
7526+ blocklist = [
7527+ "Creating scratch directories is taking a surprisingly long time" ,
7528+ "Future exception was never retrieved" ,
7529+ "tornado.util.TimeoutError" ,
7530+ ]
7531+ lines2 = [line for line in lines if not any (ign in line for ign in blocklist )]
7532+ # Instant failure for messages not in blocklist
7533+ assert not lines2
7534+ # Retry up to 5 times if the only messages are in the blocklist
7535+ assert not lines , "Found blocklist match, retrying: " + str (lines )
75237536
75247537
75257538@gen_cluster (client = False , nthreads = [])
0 commit comments