testing: fix duplicated test items if ext host restarts

Fixes #128341
This commit is contained in:
Connor Peet
2021-07-09 11:38:44 -07:00
parent 73f3a2726e
commit 9044b2c162
2 changed files with 12 additions and 4 deletions

View File

@@ -37,7 +37,6 @@ const reviveDiff = (diff: TestsDiff) => {
export class MainThreadTesting extends Disposable implements MainThreadTestingShape, ITestRootProvider {
private readonly proxy: ExtHostTestingShape;
private readonly diffListener = this._register(new MutableDisposable());
private readonly testSubscriptions = new Map<string, IDisposable>();
private readonly testProviderRegistrations = new Map<string, IDisposable>();
constructor(
@@ -205,10 +204,10 @@ export class MainThreadTesting extends Disposable implements MainThreadTestingSh
public override dispose() {
super.dispose();
for (const subscription of this.testSubscriptions.values()) {
for (const subscription of this.testProviderRegistrations.values()) {
subscription.dispose();
}
this.testSubscriptions.clear();
this.testProviderRegistrations.clear();
}
private withLiveRun<T>(runId: string, fn: (run: LiveTestResult) => T): T | undefined {