Skip to content

test: stabilize flaky integration teardown#1016

Open
AshishAnshoo wants to merge 1 commit into
mainfrom
test/AshishAnshoo/fix-flaky-integration-teardown
Open

test: stabilize flaky integration teardown#1016
AshishAnshoo wants to merge 1 commit into
mainfrom
test/AshishAnshoo/fix-flaky-integration-teardown

Conversation

@AshishAnshoo

Copy link
Copy Markdown
Collaborator

Fix the intermittent CI 'Test' failure (EnvironmentTeardownError: Closing rpc while onUserConsoleLog was pending, blamed on messages.test.tsx).

  • onramp useOnrampForm.spec: add the missing useNetworkStore export to the wallet-core-blockchain mock. Analytics reads useNetworkStore.getState() on every trackEvent; without it each call logged 'No useNetworkStore export on the mock' (9x), and that pending console forwarding races worker teardown.
  • integration setup afterEach: drain the macrotask queue so late background async (polling logger.warn) forwards its console within the test window, not at worker close. Same root cause the waitForConfirmation mock addresses.

Test-only. No app/runtime code touched.

Pull Request Template

Description

  • Please provide a brief description of the changes made in this pull request.

Related Issues

Checklist

  • Have you tested your changes locally?
  • Have you reviewed the code for any potential issues?
  • Have you documented any necessary changes in the project's documentation?
  • Have you added any necessary tests for your changes?
  • Have you updated any relevant dependencies?

Additional Notes

  • Add any additional notes or comments that may be helpful for reviewers.

@AshishAnshoo
AshishAnshoo requested a review from a team as a code owner July 23, 2026 16:02
Fix the intermittent CI 'Test' failure (EnvironmentTeardownError: Closing rpc
while onUserConsoleLog was pending, blamed on messages.test.tsx).

- onramp useOnrampForm.spec: add the missing useNetworkStore export to the
  wallet-core-blockchain mock. Analytics reads useNetworkStore.getState() on
  every trackEvent; without it each call logged 'No useNetworkStore export on
  the mock' (9x), and that pending console forwarding races worker teardown.
- integration setup afterEach: drain the macrotask queue so late background
  async (polling logger.warn) forwards its console within the test window,
  not at worker close. Same root cause the waitForConfirmation mock addresses.

Test-only. No app/runtime code touched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AshishAnshoo
AshishAnshoo force-pushed the test/AshishAnshoo/fix-flaky-integration-teardown branch from a9e5bc3 to 2bb6d7a Compare July 23, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant