-
Notifications
You must be signed in to change notification settings - Fork 14
chore: sort out lot of flaky CI issues #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: sort out lot of flaky CI issues #366
Conversation
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
44cd342 to
45cddc4
Compare
|
View your CI Pipeline Execution ↗ for commit 96bf56f
☁️ Nx Cloud last updated this comment at |
| } finally { | ||
| await supabase.removeChannel(channel); | ||
| await sql.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resource leak: If supabase.removeChannel(channel) throws an error, sql.end() will never be called, leaving the PostgreSQL connection open.
This will cause connection pool exhaustion over time. The fix is to handle cleanup independently:
finally {
await Promise.allSettled([
supabase.removeChannel(channel),
sql.end()
]);
}This ensures both cleanup operations are attempted regardless of whether either fails.
| } finally { | |
| await supabase.removeChannel(channel); | |
| await sql.end(); | |
| } finally { | |
| await Promise.allSettled([ | |
| supabase.removeChannel(channel), | |
| sql.end() | |
| ]); | |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
0bb3550 to
7283c3a
Compare
0a0445c to
b23f159
Compare
03c2baf to
044c088
Compare
044c088 to
a920aa6
Compare
a920aa6 to
96bf56f
Compare
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-366.pgflow.pages.dev 📝 Details:
_Last updated: _ |
Merge activity
|
# Fix Supabase connectivity issues and improve test reliability ### TL;DR This PR addresses Supabase connectivity issues in CI by configuring Docker ulimits, improves test reliability with channel stabilization delays, and enhances article worker tests with proper mocking. ### What changed? - Added Docker daemon configuration in GitHub Actions to allow containers to set high ulimits (prevents "ulimit: open files" errors in Supabase containers) - Improved client tests by adding stabilization delay for realtime channels to fully establish routing - Refactored article flow worker tests to use proper mocking instead of real HTTP requests - Updated Claude bash command patterns in settings.json to use proper syntax - Simplified client project.json by removing redundant db:ensure target and integrating database setup directly into test commands - Added test-stability.sh script to verify channel stabilization reliability - Added separate vitest config for type checking that doesn't need global setup ### How to test? 1. Run client tests with `nx test client` to verify they pass consistently 2. Test article worker with `cd apps/demo/supabase/functions/article_flow_worker && deno test` 3. Run the stability test script: `cd pkgs/client && ./test-stability.sh 10` 4. Verify CI workflow completes successfully ### Why make this change? The changes address several reliability issues: 1. Supabase containers were failing in CI due to ulimit restrictions 2. Client tests were flaky due to race conditions in realtime channel subscriptions 3. Article worker tests were making real HTTP requests, making them brittle and slow 4. The test setup was unnecessarily complex with separate database preparation steps These improvements make the tests more reliable, faster, and less dependent on external services, resulting in more consistent CI runs and developer experience.

Fix Supabase connectivity issues and improve test reliability
TL;DR
This PR addresses Supabase connectivity issues in CI by configuring Docker ulimits, improves test reliability with channel stabilization delays, and enhances article worker tests with proper mocking.
What changed?
How to test?
nx test clientto verify they pass consistentlycd apps/demo/supabase/functions/article_flow_worker && deno testcd pkgs/client && ./test-stability.sh 10Why make this change?
The changes address several reliability issues:
These improvements make the tests more reliable, faster, and less dependent on external services, resulting in more consistent CI runs and developer experience.