Repository navigation
Give AttachProcessProvider suite the shared TEST_TIMEOUT - #1150
Open
TEJA P C (PCTEJA) wants to merge 1 commit into
Open
TEJA P C (PCTEJA) wants to merge 1 commit into
TEJA P C (PCTEJA) wants to merge 1 commit into
Conversation
On a cold start, the first test in this suite can exceed Mocha's 2s default timeout (initial module loading). When it times out, its still-pending async work completes during the next test and records extra calls on that test's sinon stubs, failing it intermittently (e.g. 'expected plainExec to be called once but it was called twice'). Use the repository's shared TEST_TIMEOUT (60s, src/test/constants.ts) for the suite, following the existing this.timeout(TEST_TIMEOUT) pattern used elsewhere in the test suite. Fixes microsoft#1031
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1031.
The
Attach to process - process providersuite intermittently fails on the first run: on a cold start, the first test can exceed Mocha's 2s default timeout (initial module loading). When it times out, its still-pending async work completes during the next test and records extra calls on that test's sinon stubs, failing it with errors likeexpected plainExec to be called once but it was called twice.Change
Test-only, one file (
src/test/unittest/attachQuickPick/provider.unit.test.ts): give the suite the repository's shared timeout instead of the 2s default —TEST_TIMEOUT(60s) is the existing shared constant insrc/test/constants.ts, andthis.timeout(TEST_TIMEOUT)is the pattern already used elsewhere in this repo's tests (e.g.reportIssueCommand.unit.test.ts). With the first test no longer timing out under cold-start load, its async work completes within its own test and cannot pollute the next test's stubs. No assertions, stubs, or production code change.Testing
provider.unit.test.tsdue to slow initial execution #1031.npm run compile-tests(tsc) passes;eslintandprettier --checkpass on the changed file.This change was prepared with AI assistance (Muse, validated with Codex); I have reviewed every changed line and take responsibility for it.