Skip to content

fix: dispatcher tests fail in CI due to shared module state#257

Merged
anandgupta42 merged 1 commit intomainfrom
fix/dispatcher-test-shared-state
Mar 18, 2026
Merged

fix: dispatcher tests fail in CI due to shared module state#257
anandgupta42 merged 1 commit intomainfrom
fix/dispatcher-test-shared-state

Conversation

@anandgupta42
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes 11 test failures in CI by replacing side-effect imports with explicit registerAll() calls in beforeAll. Dispatcher.reset() in dispatcher.test.ts clears the shared nativeHandlers Map, and since Bun shares modules across test files, the one-time side-effect imports never re-register handlers.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Issue for this PR

Closes #256

How did you verify your code works?

  • Ran both dispatcher.test.ts and schema-finops-dbt.test.ts together in both orderings — 58/58 pass
  • Ran full test suite — 3294 pass, 0 new failures

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • New and existing unit tests pass locally with my changes

🤖 Generated with Claude Code

`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
Copy link
Copy Markdown

claude bot commented Mar 18, 2026

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

@anandgupta42 anandgupta42 merged commit fc9fe41 into main Mar 18, 2026
7 checks passed
@anandgupta42 anandgupta42 deleted the fix/dispatcher-test-shared-state branch March 25, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dispatcher tests fail in CI due to shared module state

1 participant