File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -113,5 +113,20 @@ public function throwIfFailedOnTerm(): void
113
113
throw new ProcessFailedException ($ this ->serviceProcess );
114
114
}
115
115
116
+ public function waitForTermination (int $ timeout ): void
117
+ {
118
+ $ elapsed = 0 ;
119
+ $ sleepInterval = 100 ; // Sleep for 100 milliseconds
120
+
121
+ while ($ this ->serviceProcess ->isRunning () && $ elapsed < $ timeout ) {
122
+ usleep ($ sleepInterval * 1000 );
123
+ $ elapsed += $ sleepInterval ;
124
+ }
125
+
126
+ if ($ this ->serviceProcess ->isRunning ()) {
127
+ throw new XsslessException ('Process did not terminate within the given timeout ' );
128
+ }
129
+ }
130
+
116
131
// ========================================================================
117
132
}
Original file line number Diff line number Diff line change 70
70
));
71
71
72
72
expect (fn () => $ service ->start ())->toThrow (ProcessFailedException::class);
73
- expect ($ service ->serviceProcess ->getTermSignal ())->toBe (127 );
74
- // TODO: fix https://github.com/medilies/xssless/actions/runs/10283025153/job/28455979969
75
- // TODO: wait for signal
73
+ $ service ->waitForTermination (1000 );
74
+ expect ($ service ->serviceProcess ->getExitCode ())->toBe (127 );
76
75
});
You can’t perform that action at this time.
0 commit comments