File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ public function run(): void
8383 {
8484 // todo startup configs
8585 // write down the LARAVEL_START constant value for future usage
86- $ this ->laravelStartVal = constant ("LARAVEL_START " );
86+ $ this ->laravelStartVal = constant ("LARAVEL_START " ) ?? null ;
8787
8888 // install a timeout detector
8989 // this single function checks all kinds of timeouts
@@ -257,10 +257,13 @@ protected function checkTaskTimeout(): void
257257
258258 // external killing; could be normal Unix timeout SIG_TERM or manual Windows taskkill
259259 // Laravel Artisan very conveniently has a LARAVEL_START = microtime(true) to let us check time elapsed
260- $ timeElapsed = microtime (true ) - $ this ->laravelStartVal ;
261- if ($ timeElapsed > $ this ->timeLimit ) {
262- // timeout!
263- $ hasTimedOut = true ;
260+ if ($ this ->laravelStartVal !== null ) {
261+ // we know when we have started; this can be null when running some test cases
262+ $ timeElapsed = microtime (true ) - $ this ->laravelStartVal ;
263+ if ($ timeElapsed > $ this ->timeLimit ) {
264+ // timeout!
265+ $ hasTimedOut = true ;
266+ }
264267 }
265268
266269 // runtime timeout triggers a PHP fatal error
You can’t perform that action at this time.
0 commit comments