From 9f70c92b79ffbc986fda32cf4146e354bd1dd168 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 12 May 2026 19:28:54 +0300 Subject: [PATCH 1/2] fix: restore protected modifier on relayCreationTimeoutMs in test helper The `relayCreationTimeoutMs` override in `TestableSSHRemoteAgentHostMainService` was missing its `protected` modifier, causing the mangler to promote it to `public` and fail the `compile-build-with-mangling` step with: ERROR: Protected fields have been made PUBLIC. This hurts minification and is therefore not allowed. Re-add `protected` to the override declaration to keep the field's visibility consistent with the base class and satisfy the mangler. --- .../agentHost/test/node/sshRemoteAgentHostService.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts b/src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts index faa69ebd589..912704bafa8 100644 --- a/src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts +++ b/src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts @@ -174,7 +174,7 @@ class TestableSSHRemoteAgentHostMainService extends SSHRemoteAgentHostMainServic hangRelayCreationOnCall: number | undefined; /** Public override so tests can shorten the relay creation timeout. */ - override relayCreationTimeoutMs: number = 30_000; + protected override relayCreationTimeoutMs: number = 30_000; /** Stored onMessage callbacks from relays, most recent last. */ private readonly _relayMessageCallbacks: Array<(data: string) => void> = []; From c5061c3b6ac5ecbb6b579d2633846daa07376e66 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 12 May 2026 20:30:42 +0300 Subject: [PATCH 2/2] fix: expose relayCreationTimeoutMs via test-only setter to satisfy mangler The field `relayCreationTimeoutMs` is `protected` in the base class. The test subclass `TestableSSHRemoteAgentHostMainService` had overridden it without an explicit access modifier, making it implicitly `public`. The mangler correctly rejected this as it hurts minification. Adding `protected` back satisfied the mangler but caused a TS2445 error since the test was assigning to the field directly on an instance, which is illegal for `protected` members outside the class hierarchy. Fix by adding a narrow public setter `setRelayCreationTimeoutForTest` in the test subclass. The field stays `protected`; the setter provides a legitimate public entry point for tests. Signed-off-by: Nikola Hristov --- .../agentHost/test/node/sshRemoteAgentHostService.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts b/src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts index 912704bafa8..6e6c87109e5 100644 --- a/src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts +++ b/src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts @@ -279,6 +279,11 @@ class TestableSSHRemoteAgentHostMainService extends SSHRemoteAgentHostMainServic this._relayCloseCallbacks[this._relayCloseCallbacks.length - 1](); } } + + /** Sets the relay creation timeout; exposed for tests only. */ + setRelayCreationTimeoutForTest(ms: number): void { + this.relayCreationTimeoutMs = ms; + } } suite('SSHRemoteAgentHostMainService - connect flow', () => { @@ -1017,7 +1022,7 @@ suite('SSHRemoteAgentHostMainService - connect flow', () => { assert.strictEqual(originalClient.ended, false); // Use a short timeout so the test completes quickly. - service.relayCreationTimeoutMs = 50; + service.setRelayCreationTimeoutForTest(50); // Make the *reconnect* call's relay creation hang (the second relay). service.hangRelayCreationOnCall = 2;