File tree 3 files changed +15
-3
lines changed
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 {
86
86
[ ...files . map ( f => relative ( project . config . root , f ) ) ] . join ( ', ' ) ,
87
87
)
88
88
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 )
91
96
}
92
97
else {
93
98
const contextId = crypto . randomUUID ( )
@@ -156,6 +161,11 @@ export function createBrowserPool(ctx: Vitest): ProcessPool {
156
161
async close ( ) {
157
162
await Promise . all ( [ ...providers ] . map ( provider => provider . close ( ) ) )
158
163
providers . clear ( )
164
+ ctx . resolvedProjects . forEach ( ( project ) => {
165
+ project . browser ?. state . orchestrators . forEach ( ( orchestrator ) => {
166
+ orchestrator . $close ( )
167
+ } )
168
+ } )
159
169
} ,
160
170
runTests : files => runWorkspaceTests ( 'run' , files ) ,
161
171
collectTests : files => runWorkspaceTests ( 'collect' , files ) ,
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ export class Vitest {
77
77
78
78
private coreWorkspaceProject ! : WorkspaceProject
79
79
80
- private resolvedProjects : WorkspaceProject [ ] = [ ]
80
+ /** @private */
81
+ public resolvedProjects : WorkspaceProject [ ] = [ ]
81
82
public projects : WorkspaceProject [ ] = [ ]
82
83
83
84
public distPath = distDir
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ export interface BrowserServerStateContext {
194
194
export interface BrowserOrchestrator {
195
195
createTesters : ( files : string [ ] ) => Promise < void >
196
196
onCancel : ( reason : CancelReason ) => Promise < void >
197
+ $close : ( ) => void
197
198
}
198
199
199
200
export interface BrowserServerState {
You can’t perform that action at this time.
0 commit comments