fix: dispatcher tests fail in CI due to shared module state#257
Merged
anandgupta42 merged 1 commit intomainfrom Mar 18, 2026
Merged
fix: dispatcher tests fail in CI due to shared module state#257anandgupta42 merged 1 commit intomainfrom
anandgupta42 merged 1 commit intomainfrom
Conversation
`Dispatcher.reset()` in `dispatcher.test.ts` clears the shared `nativeHandlers` Map. Since Bun shares modules across test files in the same process, side-effect imports in `schema-finops-dbt.test.ts` only run once at module load — if another test resets the dispatcher afterward, handlers are gone permanently. Replace side-effect imports with explicit `registerAll()` calls in `beforeAll` so handlers are re-registered regardless of test execution order. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude Code ReviewThis repository is configured for manual code reviews. Comment |
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.
What does this PR do?
Fixes 11 test failures in CI by replacing side-effect imports with explicit
registerAll()calls inbeforeAll.Dispatcher.reset()indispatcher.test.tsclears the sharednativeHandlersMap, and since Bun shares modules across test files, the one-time side-effect imports never re-register handlers.Type of change
Issue for this PR
Closes #256
How did you verify your code works?
dispatcher.test.tsandschema-finops-dbt.test.tstogether in both orderings — 58/58 passChecklist
🤖 Generated with Claude Code