Repository navigation
test(ssh): clear SSH session holds between connection test files - #40673
Conversation
…n fixture The fixture reset now clears credential declines as well as user disconnects, so every suite built on it starts without a stale hold from an earlier file in the same worker. The per-suite resets it supersedes are removed. Fixes #40291
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
ELI5
Some SSH tests leave a "this host was disconnected" or "sign-in was cancelled" mark behind. When test files share a worker, the next file sees that mark and its SSH connections are refused. Unrelated tests then fail. This PR clears both marks before every test that could be affected.
What Changed
ssh-connection-manager.test.tsnow clears the credential-decline and user-disconnect stores before and after every case, not only in two describe blocks. This is gentslava's commit from test(ssh): isolate connection-manager session holds #40293, cherry-picked with authorship kept.resetSshConnectionMocks) now clears credential declines too. test(ssh): reset user disconnect state in connection fixtures #40525 already made it clear user disconnects. Every suite built on the fixture now starts with no session holds. The per-suite resets this replaces, in sign-in-reuse and wake-retry, are removed.Why
The two hold stores are module-level state, so in the shared-worker test project they outlive a file. Resetting them in the victims (the manager suite and the shared fixture) covers every suite that reads them. Chasing each file that leaves a hold behind would miss future cases.
Linked Issue
Fixes #40291
Credit: gentslava reported #40291 and wrote #40293. AmethystLiang fixed the fixture side in #40525, which is merged.
Visual Proof
N/A: test-only change.
Testing
I simulated a leaked hold by seeding
recordSshUserDisconnected('target-1')andrecordSshCredentialDeclined('target-1')at module load inssh-connection-manager.test.tsandssh-connection-loopback-cancel.test.ts. On main, 9 tests fail. On this branch, all 12 pass. All 16 test files that import the fixture or the manager suite pass (77 tests). Typecheck and the static job pass.Risk
Level: Low. Test-only. Back it out with a plain revert.
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist