File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ async function main() {
200200 process . stdout . write ( `Providers: ${ args . providerIDs . join ( ", " ) } \n` )
201201 process . stdout . write ( `Timeout: ${ args . timeoutMs } ms, Delay: ${ args . delayMs } ms\n\n` )
202202
203+ let hadFailure = false
203204 await Instance . provide ( {
204205 directory : process . cwd ( ) ,
205206 async fn ( ) {
@@ -241,6 +242,7 @@ async function main() {
241242 process . stdout . write ( "OK\n" )
242243 } else {
243244 failCount ++
245+ hadFailure = true
244246 process . stdout . write ( `FAIL (${ result . error } )\n` )
245247 }
246248
@@ -253,6 +255,11 @@ async function main() {
253255 }
254256 } ,
255257 } )
258+
259+ // Important: OpenCode may start background servers/plugins that keep the event loop alive.
260+ // Dispose all instance state and exit explicitly.
261+ await Instance . disposeAll ( )
262+ process . exit ( hadFailure ? 1 : 0 )
256263}
257264
258265await main ( )
You can’t perform that action at this time.
0 commit comments