Skip to content

Fix flaky ClickHouse test: add per-request timeout#1201

Closed
BilalG1 wants to merge 1 commit into
devfrom
clickhouse-flaky-fix-0
Closed

Fix flaky ClickHouse test: add per-request timeout#1201
BilalG1 wants to merge 1 commit into
devfrom
clickhouse-flaky-fix-0

Conversation

@BilalG1
Copy link
Copy Markdown
Collaborator

@BilalG1 BilalG1 commented Feb 16, 2026

Summary

  • Adds a 30s per-request timeout (via Promise.race) to waitForClickhouseUser and waitForClickhouseUserDeletion in the ClickHouse sync test
  • If a single runQueryForCurrentProject call hangs (backend overloaded by parallel sync-engine webhooks), the polling loop now continues instead of blocking until the vitest timeout fires

Theory

niceFetch calls fetch() with no timeout. If a single request hangs, the inner polling timeout never fires (it only checks at the top of the while loop). The test hits the vitest timeout instead.

Test plan

  • CI should pass on this branch
  • The "Updates to user are synced to ClickHouse" test should stop intermittently timing out

If a single runQueryForCurrentProject call hangs (e.g. backend
overloaded by parallel sync-engine webhooks), the inner polling
timeout never fires because it only checks at the top of the while
loop. This causes the test to hit the vitest timeout instead of
retrying.

Add a 30s per-request timeout via Promise.race in both
waitForClickhouseUser and waitForClickhouseUserDeletion. If a
request exceeds 30s, the loop continues polling instead of blocking.
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stack-backend Ready Ready Preview, Comment Feb 16, 2026 8:29pm
stack-dashboard Ready Ready Preview, Comment Feb 16, 2026 8:29pm
stack-demo Ready Ready Preview, Comment Feb 16, 2026 8:29pm
stack-docs Ready Ready Preview, Comment Feb 16, 2026 8:29pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch clickhouse-flaky-fix-0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@BilalG1 BilalG1 closed this Feb 16, 2026
@BilalG1 BilalG1 deleted the clickhouse-flaky-fix-0 branch February 16, 2026 20:51
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.

1 participant