fix(tests): resolve remaining flaky tests after Vitest migration#3242
Open
vseehausen wants to merge 3 commits into
Open
fix(tests): resolve remaining flaky tests after Vitest migration#3242vseehausen wants to merge 3 commits into
vseehausen wants to merge 3 commits into
Conversation
Three tests kept flaking after #3139 (all surfaced via Datadog CI Pipeline Health, which our log-scraping report missed once the suite moved to Vitest): - name.builder: nameBuilder() sanitized (trimmed) the faker name and THEN truncated to NAME_MAX_LENGTH; the cut could land right after a space and re-introduce trailing whitespace, so sanitizeName(name) !== name. Re-sanitize after truncation so the result is a fixed point. - bridge-name.entity.spec: the 'unknown bridge name' case used faker.word.noun(), which can itself be a bridge name (omni, polygon, across, gnosis, ...), making safeParse succeed and the assertion flip. Resample until the word is genuinely not a bridge name. - integration specs: afterEach/afterAll called 'await app.close()' unguarded, so any beforeEach failure left app undefined and every test in the file reported 'Cannot read properties of undefined (reading close)' instead of the real error. Guarded with 'await app?.close()' across all integration specs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
@claude review |
|
Claude finished @PooyaRaki's task in 1m 33s —— View job Claude PR Review (re-review)
Follow-up looks good — LGTM. No further blockers from me. Verified
Nits (non-blocking, informational)None new. Previously-raised #3 (theoretical Ship it. |
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 three tests that kept flaking after #3139. All three were visible in Datadog CI Pipeline Health but missed by our own flaky-test report, whose log parser is Jest-specific and went blind once the suite moved to Vitest (#3136).
name.builder—nameBuilder()sanitized (trimmed) the faker name and then truncated toNAME_MAX_LENGTH; the cut could land right after a space and re-introduce trailing whitespace, sosanitizeName(name) !== name. Now re-sanitizeName()after truncation so the result is a fixed point.bridge-name.entity.spec— the "unknown bridge name" case usedfaker.word.noun(), which can itself be a bridge name (omni,polygon,across,gnosis, …), makingsafeParsesucceed and the assertion flip toexpected false to deeply equal …. Now resamples until the word is genuinely not a bridge name.afterEach/afterAllcalledawait app.close()unguarded, so anybeforeEachfailure leftappundefined and every test in the file reportedCannot read properties of undefined (reading 'close')instead of the real error (the "27 tests fail at teardown" cascade). Guarded withawait app?.close().Testing
yarn test:unitforname.builder+bridge-name.entity→ passbiome checkclean;tscintroduces no new errorsRelated