testing: fix error if a test state is updated synchronously on a detached test run

Fixes #126186
This commit is contained in:
Connor Peet 2021-06-14 10:51:23 -07:00
parent 320216dfe4
commit 478f95345c
No known key found for this signature in database
GPG key ID: CF8FD2EA0DBC61BD

View file

@ -386,7 +386,6 @@ class TestRunQueue {
}
const dto = TestRunDto.fromPublic(request);
const task = new TestRunTask(name, dto, new Set(), this.proxy);
this.proxy.$startedExtensionTestRun({
debug: request.debug,
exclude: request.exclude?.map(t => t.id) ?? [],
@ -394,6 +393,7 @@ class TestRunQueue {
tests: request.tests.map(t => t.id),
persist: persist
});
const task = new TestRunTask(name, dto, new Set(), this.proxy);
task.onEnd.wait().then(() => this.proxy.$finishedExtensionTestRun(dto.id));
return task;
}