File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,13 @@ export function createBrowserPool(ctx: Vitest): ProcessPool {
8686 [ ...files . map ( f => relative ( project . config . root , f ) ) ] . join ( ', ' ) ,
8787 )
8888 const promise = waitForTests ( method , contextId , project , files )
89- promises . push ( promise )
90- orchestrator . createTesters ( files )
89+ const tester = orchestrator . createTesters ( files ) . catch ( ( error ) => {
90+ if ( error instanceof Error && error . message . startsWith ( '[birpc] rpc is closed' ) ) {
91+ return
92+ }
93+ return Promise . reject ( error )
94+ } )
95+ promises . push ( promise , tester )
9196 }
9297 else {
9398 const contextId = crypto . randomUUID ( )
@@ -156,6 +161,11 @@ export function createBrowserPool(ctx: Vitest): ProcessPool {
156161 async close ( ) {
157162 await Promise . all ( [ ...providers ] . map ( provider => provider . close ( ) ) )
158163 providers . clear ( )
164+ ctx . resolvedProjects . forEach ( ( project ) => {
165+ project . browser ?. state . orchestrators . forEach ( ( orchestrator ) => {
166+ orchestrator . $close ( )
167+ } )
168+ } )
159169 } ,
160170 runTests : files => runWorkspaceTests ( 'run' , files ) ,
161171 collectTests : files => runWorkspaceTests ( 'collect' , files ) ,
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ export class Vitest {
7777
7878 private coreWorkspaceProject ! : WorkspaceProject
7979
80- private resolvedProjects : WorkspaceProject [ ] = [ ]
80+ /** @private */
81+ public resolvedProjects : WorkspaceProject [ ] = [ ]
8182 public projects : WorkspaceProject [ ] = [ ]
8283
8384 public distPath = distDir
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ export interface BrowserServerStateContext {
194194export interface BrowserOrchestrator {
195195 createTesters : ( files : string [ ] ) => Promise < void >
196196 onCancel : ( reason : CancelReason ) => Promise < void >
197+ $close : ( ) => void
197198}
198199
199200export interface BrowserServerState {
You can’t perform that action at this time.
0 commit comments