@@ -18,7 +18,12 @@ import * as stream from "stream";
18
18
import * as os from "os" ;
19
19
import * as asyncfs from "fs/promises" ;
20
20
import { FolderContext } from "../FolderContext" ;
21
- import { compactMap , execFile , getErrorDescription } from "../utilities/utilities" ;
21
+ import {
22
+ compactMap ,
23
+ execFile ,
24
+ getErrorDescription ,
25
+ IS_PRODUCTION_BUILD ,
26
+ } from "../utilities/utilities" ;
22
27
import { createSwiftTask } from "../tasks/SwiftTaskProvider" ;
23
28
import configuration from "../configuration" ;
24
29
import { WorkspaceContext } from "../WorkspaceContext" ;
@@ -239,6 +244,11 @@ export class TestRunProxy {
239
244
}
240
245
241
246
private clearEnqueuedTest ( test : vscode . TestItem ) {
247
+ if ( IS_PRODUCTION_BUILD ) {
248
+ // `runState.enqueued` exists only for test validation purposes.
249
+ return ;
250
+ }
251
+
242
252
this . runState . enqueued = this . runState . enqueued . filter ( t => t !== test ) ;
243
253
244
254
if ( ! test . parent ) {
@@ -264,6 +274,7 @@ export class TestRunProxy {
264
274
}
265
275
266
276
public passed ( test : vscode . TestItem , duration ?: number ) {
277
+ this . clearEnqueuedTest ( test ) ;
267
278
this . runState . passed . push ( test ) ;
268
279
this . clearPendingTest ( test ) ;
269
280
this . testRun ?. passed ( test , duration ) ;
@@ -274,6 +285,7 @@ export class TestRunProxy {
274
285
message : vscode . TestMessage | readonly vscode . TestMessage [ ] ,
275
286
duration ?: number
276
287
) {
288
+ this . clearEnqueuedTest ( test ) ;
277
289
this . runState . failed . push ( { test, message } ) ;
278
290
this . clearPendingTest ( test ) ;
279
291
this . testRun ?. failed ( test , message , duration ) ;
@@ -284,6 +296,7 @@ export class TestRunProxy {
284
296
message : vscode . TestMessage | readonly vscode . TestMessage [ ] ,
285
297
duration ?: number
286
298
) {
299
+ this . clearEnqueuedTest ( test ) ;
287
300
this . runState . errored . push ( test ) ;
288
301
this . clearPendingTest ( test ) ;
289
302
this . testRun ?. errored ( test , message , duration ) ;
0 commit comments