test(server): drop flaky account error-mapping test#26475
Merged
Conversation
The test used \`mock.module(\"@/account/account\", ...)\` to inject a failing service. Bun's mock.module applies at module-load time — if any other test file imports \`@/account/account\` (transitively, via \`Server.Default()\`) BEFORE this file's mock.module call runs, the mock is silently ignored and both tests fail with \"expected 500, received 200\". The flakiness is load-order-dependent and shifts whenever new tests are added elsewhere in the suite. It's been blocking CI on every PR since the test landed. The behavior under test is two lines: an \`Effect.catch\` mapping a service failure to \`HttpApiError.InternalServerError\` and the endpoint's \`error: HttpApiError.InternalServerError\` declaration. Code review is sufficient; the integration test buys little for the flake cost. Todo \`m0ra36\` tracks the proper fix (custom test runtime that provides Account.Service via a layer override, bypassing mock.module entirely) for whenever we want behavioral coverage back.
katosun2
pushed a commit
to katosun2/opencode
that referenced
this pull request
May 10, 2026
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 test used `mock.module("@/account/account", ...)` to inject a failing service. Bun's mock.module applies at module-load time — if any other test file imports `@/account/account` (transitively, via `Server.Default()`) BEFORE this file's mock.module call runs, the mock is silently ignored and both tests fail with "expected 500, received 200".
The flakiness is load-order-dependent and shifts whenever new tests are added elsewhere in the suite. It's been blocking CI on every PR since the test landed.
The behavior under test is two lines: an `Effect.catch` mapping a service failure to `HttpApiError.InternalServerError` and the endpoint's `error: HttpApiError.InternalServerError` declaration. Code review is sufficient; the integration test buys little for the flake cost.
Todo `m0ra36` tracks the proper fix (custom test runtime that provides Account.Service via a layer override, bypassing mock.module entirely) for whenever we want behavioral coverage back.
Test plan