test(frontend): use MockLink catch-all handler to fix Routes.test.tsx timeout#16383
Open
daha wants to merge 4 commits into
Open
test(frontend): use MockLink catch-all handler to fix Routes.test.tsx timeout#16383daha wants to merge 4 commits into
daha wants to merge 4 commits into
Conversation
Contributor
|
Linear: CAT-1423 |
9442e12 to
a4bb560
Compare
… timeout Replace individual GraphQL mocks with a MockLink setOnError catch-all that returns empty data for unmatched queries instead of erroring. This eliminates error-handling/retry overhead in the component tree that caused timeouts on slow CI runners. Also increases the embed test timeout to 15s as a safety net.
c3ad87a to
2d680d5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
|
Linear: CAT-1427 |
gabe-lyons
approved these changes
Mar 9, 2026
Contributor
|
thanks for the contribution @daha |
Contributor
|
Your PR has been assigned to gabe for review (CAT-1423). |
Bundle ReportBundle size has no change ✅ |
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
The
renders embed page properlytest inRoutes.test.tsxtimes out on fork CI runners (2-CPU). The root cause is the cumulative cost of the full<Routes />component tree rendering, compounded by error-handling and retry logic in components that receive errors from unmatched GraphQL queries. Apollo'sMockLinkcallsobserver.error()for any query without a matching mock, and adding mocks one-by-one proved to be a losing game as the component tree fires many queries.Fix: Create a custom
MockLinkwith asetOnErrorcatch-all handler that returns empty data ({ data: {} }) for any unmatched query instead of erroring. This eliminates the error-handling overhead and makes the test resilient tofuture component changes that introduce new queries. Also increases the test timeout to 15s as a safety net for slow runners.
Additionally keeps the
manageServiceAccounts: truefix added to the inlineGetMemock in a prior commit, and removes the individual mocks that were added in previous attempts (GetGlobalViewsSettings,GetHomePageSettings,BatchGetStepStates,GetSearchAcrossLineageCounts) since the catch-all makes them unnecessary.Checklist