Skip to content

Commit 5bc4048

Browse files
committed
fix: remove cancelled flag after cancelling is finished
1 parent f0fa52b commit 5bc4048

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/runner.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,14 @@ export class TestRunner extends vscode.Disposable {
406406
const run = this.testRun = this.controller.createTestRun(request, name)
407407
this.testRunRequest = request
408408
this.testRunDefer = Promise.withResolvers()
409+
// run the next test when this one finished, or cancell or test runs if they were cancelled
409410
this.testRunDefer.promise = this.testRunDefer.promise.finally(() => {
410411
run.end()
411412
if (this.cancelled) {
412413
log.verbose?.('Not starting a new test run because the previous one was cancelled manually.')
413414
this.scheduleTestRunsQueue.forEach(item => item.resolveWithoutRunning())
414415
this.scheduleTestRunsQueue.length = 0
416+
this.cancelled = false
415417
}
416418
else {
417419
log.verbose?.(`Test run promise is finished, the queue is ${this.scheduleTestRunsQueue.length}`)

0 commit comments

Comments
 (0)