@@ -1230,6 +1230,7 @@ def test_run_subprocess(self) -> None:
1230
1230
1231
1231
self .assertEqual (result .status , ResultStatus .COMPLETE )
1232
1232
1233
+ @skipIf (sys .platform == "win32" , "Terminate is always forceful on Windows" )
1233
1234
def test_interrupt_no_tasks (self ) -> None :
1234
1235
process = self .start_worker ()
1235
1236
@@ -1240,6 +1241,7 @@ def test_interrupt_no_tasks(self) -> None:
1240
1241
process .wait (timeout = 0.5 )
1241
1242
self .assertEqual (process .returncode , 0 )
1242
1243
1244
+ @skipIf (sys .platform == "win32" , "Cannot emulate CTRL-C on Windows" )
1243
1245
def test_interrupt_signals (self ) -> None :
1244
1246
for sig in [
1245
1247
signal .SIGINT , # ctrl-c
@@ -1266,6 +1268,7 @@ def test_interrupt_signals(self) -> None:
1266
1268
1267
1269
self .assertEqual (result .status , ResultStatus .COMPLETE )
1268
1270
1271
+ @skipIf (sys .platform == "win32" , "Cannot emulate CTRL-C on Windows" )
1269
1272
def test_repeat_ctrl_c (self ) -> None :
1270
1273
result = test_tasks .hang .enqueue ()
1271
1274
@@ -1346,15 +1349,14 @@ def test_keyboard_interrupt_task(self) -> None:
1346
1349
self .assertIsInstance (result .exception , KeyboardInterrupt )
1347
1350
1348
1351
def test_multiple_workers (self ) -> None :
1349
- results = [test_tasks .noop_task .enqueue () for _ in range (10 )]
1352
+ results = [test_tasks .sleep_for .enqueue (0.1 ) for _ in range (10 )]
1350
1353
1351
1354
for _ in range (3 ):
1352
- self .start_worker ()
1355
+ self .start_worker ([ "--batch" ] )
1353
1356
1354
1357
time .sleep (self .WORKER_STARTUP_TIME )
1355
1358
1356
1359
for process in self .processes :
1357
- process .terminate ()
1358
1360
process .wait (timeout = 5 )
1359
1361
self .assertIsNotNone (process .returncode )
1360
1362
@@ -1367,7 +1369,7 @@ def test_multiple_workers(self) -> None:
1367
1369
for process in self .processes :
1368
1370
stdout_text = process .stdout .read () # type:ignore[union-attr]
1369
1371
all_output += stdout_text
1370
- self .assertIn ("shutting down gracefully" , stdout_text )
1372
+ self .assertIn ("gracefully" , stdout_text )
1371
1373
1372
1374
for result in results :
1373
1375
# Running and complete
0 commit comments