Skip to content

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 321170d

  • Dependency count: 1,055 (no change)
  • Package size: 317 MB ⬇️ 0.00% decrease vs. 321170d
  • Number of ts-expect-error directives: 372 ⬆️ 1.61% increase vs. 321170d

@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
// If a build is already in progress, mark that we need another build
// and return the current build's promise. The running build will
// trigger a rebuild when it completes if buildPending is true.
if (this.buildPromise) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add tests here for this method which will ensure this tests fine?

this.build() // resolved firstly
this.build() // resolved together with the next
this.build() // resolved together with the previous

Copy link
Member

Choose a reason for hiding this comment

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

^ and the test should verify that subsequent calls trigger an actual new build!

Comment on lines +187 to +189
// If a build is already in progress, mark that we need another build
// and return the current build's promise. The running build will
// trigger a rebuild when it completes if buildPending is true.
Copy link
Member

Choose a reason for hiding this comment

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

👀 Instead of reimplementing this, we could reuse the existing battle-tested helper we already use for this same purpose for (non-Edge) Functions! Check it out:

.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea thank you!

Copy link
Contributor Author

@jaredm563 jaredm563 Jan 24, 2026

Choose a reason for hiding this comment

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

So I looked into implementing that and unfortunately if build A fails while build B is pending, the caller of build A gets the error but build B runs without anyone waiting for it. I'll add a comment explaining why there is a custom implementation

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