Skip to content

Remove slow waits and redundant cases from effect tests - #10681

Open
effect-bot wants to merge 2 commits into
mainfrom
agent/nelson-effect-bot/aa5b6a4c436f
Open

effect-bot wants to merge 2 commits into
mainfrom
agent/nelson-effect-bot/aa5b6a4c436f

Conversation

@effect-bot

@effect-bot effect-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Maintenance pass on the effect test project. Three files are touched, every change was checked against a source mutation where that applies, and no source code changes.

Changes

  • test/TestClock.test.ts: the two "warnings bypass TestConsole" tests waited out the default 1s warningDelay on the live clock, one after the other (2.0s per file run). They now run under it.live and provide the same environment it.effect uses (TestConsole.layer + TestClock.layer) with a 10ms delay. it.live starts without TestConsole, so the clock captures the real console and the test can still tell the two destinations apart. Dropping the liveConsole routing from TestClock.ts still fails both tests. Because these stay on an @effect/vitest runner, a hang is still interrupted on timeout and the console spies are restored. With wake made to hang, a follow-up test sees console.log unmocked; under plain it + Effect.runPromise it stayed mocked.
  • test/cluster/ClusterWorkflowEngine.test.ts: the durable clock case of "completes ... after a transient failure" slept for 1 second, which pollUntil walks in 1ms steps (around 1000 storage polls per test). 300ms is still after the first 200ms save retry, so the clock is pending when the retry runs. Computing the deadline inside retryPersistence still fails both variants.
  • test/schema/representation/codegen.annotations.test.ts: seven reference-identifier tests that differed only in the input key (abc, Abc, 1a, a-b, café, 🤖, "") are now one table assertion. Every input/expected pair is kept, and a failure shows the whole table diff. The collision test and the identifier-annotation test stay separate because they cover different paths.

Measurements

Full effect project, pnpm vitest --run --project effect, 16 cores, shared host:

tests wall CPU (user)
before 13,778 (58 skipped) 17.6s 156.3s
after 13,772 (58 skipped) 17.4s 153.7s

That full-project difference is within noise, and other runs on the same host under load varied between 18s and 208s. The per-test numbers are consistent across all eight runs:

  • TestClock warning tests: about 1,000ms each before, 12 to 54ms after. TestClock.test.ts goes from about 2.0s to under 0.25s.
  • Durable clock retry tests: 2,142 to 2,489ms each before, 401 to 446ms after (file run with in-file concurrency off).

Closes EFF-3854

@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 02f145b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@effect-janitor effect-janitor Bot added the 4.0 label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 40.09 KB 40.09 KB 0.00 KB (0.00%)
basic.ts 7.31 KB 7.31 KB 0.00 KB (0.00%)
batching.ts 11.21 KB 11.21 KB 0.00 KB (0.00%)
brand.ts 7.00 KB 7.00 KB 0.00 KB (0.00%)
cache.ts 11.73 KB 11.73 KB 0.00 KB (0.00%)
config.ts 23.09 KB 23.09 KB 0.00 KB (0.00%)
differ.ts 22.20 KB 22.20 KB 0.00 KB (0.00%)
http-client.ts 27.45 KB 27.45 KB 0.00 KB (0.00%)
http-router.ts 37.59 KB 37.59 KB 0.00 KB (0.00%)
logger.ts 12.19 KB 12.19 KB 0.00 KB (0.00%)
metric.ts 9.65 KB 9.65 KB 0.00 KB (0.00%)
optic.ts 7.21 KB 7.21 KB 0.00 KB (0.00%)
pubsub.ts 16.21 KB 16.21 KB 0.00 KB (0.00%)
queue.ts 13.09 KB 13.09 KB 0.00 KB (0.00%)
schedule.ts 11.99 KB 11.99 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.29 KB 14.29 KB 0.00 KB (0.00%)
schema-binary.ts 42.48 KB 42.48 KB 0.00 KB (0.00%)
schema-class.ts 21.96 KB 21.96 KB 0.00 KB (0.00%)
schema-codegen.ts 30.70 KB 30.70 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 30.56 KB 30.56 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 28.26 KB 28.26 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.54 KB 15.54 KB 0.00 KB (0.00%)
schema-string.ts 12.50 KB 12.50 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.43 KB 16.43 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 39.63 KB 39.63 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 21.11 KB 21.11 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.28 KB 21.28 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.37 KB 21.37 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.42 KB 26.42 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.45 KB 21.45 KB 0.00 KB (0.00%)
schema.ts 21.05 KB 21.05 KB 0.00 KB (0.00%)
stm.ts 14.46 KB 14.46 KB 0.00 KB (0.00%)
stream.ts 10.56 KB 10.56 KB 0.00 KB (0.00%)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant