File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,9 @@ public function testAsyncTimeout()
138
138
$ task = new AsyncTask ($ timeoutTask );
139
139
$ task ->withTimeLimit (1 )->start ();
140
140
// 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 );
142
144
// should have timed out
143
145
$ this ->assertFileExists ($ textFilePath , "The async task probably did not trigger its timeout handler because its timeout output file is not found. " );
144
146
$ this ->assertStringEqualsFile ($ textFilePath , $ message );
Original file line number Diff line number Diff line change @@ -17,9 +17,12 @@ public function __construct(
17
17
public function execute (): void
18
18
{
19
19
// 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 );
23
26
}
24
27
25
28
public function handleTimeout (): void
You can’t perform that action at this time.
0 commit comments