Skip to content

Commit bb200f4

Browse files
authored
Merge pull request #316049 from CodeEditorLand/fix-protected-override-1
fix: restore protected modifier on relayCreationTimeoutMs in test helper
2 parents 5060335 + c5061c3 commit bb200f4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class TestableSSHRemoteAgentHostMainService extends SSHRemoteAgentHostMainServic
174174
hangRelayCreationOnCall: number | undefined;
175175

176176
/** Public override so tests can shorten the relay creation timeout. */
177-
override relayCreationTimeoutMs: number = 30_000;
177+
protected override relayCreationTimeoutMs: number = 30_000;
178178

179179
/** Stored onMessage callbacks from relays, most recent last. */
180180
private readonly _relayMessageCallbacks: Array<(data: string) => void> = [];
@@ -279,6 +279,11 @@ class TestableSSHRemoteAgentHostMainService extends SSHRemoteAgentHostMainServic
279279
this._relayCloseCallbacks[this._relayCloseCallbacks.length - 1]();
280280
}
281281
}
282+
283+
/** Sets the relay creation timeout; exposed for tests only. */
284+
setRelayCreationTimeoutForTest(ms: number): void {
285+
this.relayCreationTimeoutMs = ms;
286+
}
282287
}
283288

284289
suite('SSHRemoteAgentHostMainService - connect flow', () => {
@@ -1017,7 +1022,7 @@ suite('SSHRemoteAgentHostMainService - connect flow', () => {
10171022
assert.strictEqual(originalClient.ended, false);
10181023

10191024
// Use a short timeout so the test completes quickly.
1020-
service.relayCreationTimeoutMs = 50;
1025+
service.setRelayCreationTimeoutForTest(50);
10211026
// Make the *reconnect* call's relay creation hang (the second relay).
10221027
service.hangRelayCreationOnCall = 2;
10231028

0 commit comments

Comments
 (0)