File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,9 @@ public function testAsyncTimeout()
138138 $ task = new AsyncTask ($ timeoutTask );
139139 $ task ->withTimeLimit (1 )->start ();
140140 // we wait for it to timeout
141- $ this ->sleep (2 );
141+ $ this ->sleep (0.5 );
142+ $ this ->sleep (0.5 );
143+ $ this ->sleep (0.5 );
142144 // should have timed out
143145 $ this ->assertFileExists ($ textFilePath , "The async task probably did not trigger its timeout handler because its timeout output file is not found. " );
144146 $ this ->assertStringEqualsFile ($ textFilePath , $ message );
Original file line number Diff line number Diff line change @@ -17,9 +17,12 @@ public function __construct(
1717 public function execute (): void
1818 {
1919 // we have to sleep a bit to trigger the timeout
20- // the test has a timeout of 1s, so we try to sleep for 1.5s
21- sleep (1 );
22- usleep (500000 );
20+ // the test has a timeout of 1s, so we try to sleep for slightly longer than 1 seconds
21+ // this is currently 1.2 seconds
22+ usleep (300000 );
23+ usleep (300000 );
24+ usleep (300000 );
25+ usleep (300000 );
2326 }
2427
2528 public function handleTimeout (): void
You can’t perform that action at this time.
0 commit comments