Skip to content

fix: address flaky integration tests#7890

Merged
jaredm563 merged 10 commits intomainfrom
jared/address-flaky-tests
Jan 28, 2026
Merged

fix: address flaky integration tests#7890
jaredm563 merged 10 commits intomainfrom
jared/address-flaky-tests

Conversation

@jaredm563
Copy link
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

Fix 1:

Multiple file watcher events (onAdd, onChange) could trigger concurrent build() calls, causing race conditions where the bundler accessed functionConfigs[name] before it was populated .

now only one build runs at a time, and when the current build completes, it checks buildPending and runs another build if needed

Fix 2:
tests/integration/utils/dev-server.ts waited up to 90s with no useful error message, now on timeout it should shows the actual server output so far for debugging

Fix 3:
In tests/integration/commands/init/init.test.ts answerWithValue(CONFIRM) sent ['\n', '\n'] (two newlines), which was causing the second newline to answer the wrong prompt.

Now it should use a single CONFIRM for list/confirm selections, so that prompts are answered correctly and the netlify.toml gets created


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@jaredm563 jaredm563 requested a review from a team as a code owner January 23, 2026 19:10
@github-actions
Copy link

github-actions bot commented Jan 23, 2026

📊 Benchmark results

Comparing with 4a57375

  • Dependency count: 1,055 (no change)
  • Package size: 317 MB (no change)
  • Number of ts-expect-error directives: 366 (no change)

@jaredm563 jaredm563 force-pushed the jared/address-flaky-tests branch from d5e2c89 to aff59d3 Compare January 23, 2026 19:23
@jaredm563 jaredm563 changed the title Jared/address flaky tests fix: address flaky integration tests Jan 23, 2026
Comment on lines 16 to 20
// @ts-expect-error -- accessing private members for testing
registry.buildPending = false
// @ts-expect-error -- accessing private members for testing
registry.buildPromise = null
// @ts-expect-error -- accessing private members for testing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't sink your day into this, but could you take a few mins to see if we can avoid adding all these @ts-expect-errors? 🙏🏼

@jaredm563 jaredm563 requested a review from khendrikse January 28, 2026 00:54
@jaredm563 jaredm563 merged commit a329330 into main Jan 28, 2026
68 checks passed
@jaredm563 jaredm563 deleted the jared/address-flaky-tests branch January 28, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants