fix: Fix flaky CI tests - #7005
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce flakiness in the TxQ and PerfLog unit tests by making them more tolerant of persistent temp-directory state and asynchronous WebSocket message timing.
Changes:
- Add pre-test cleanup to remove any stale
PerfLogtest directory state from the system temp directory. - Update
TxQWebSocket “server” subscription test to drain unexpected extraserverStatusmessages before unsubscribing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/test/basics/PerfLog_test.cpp |
Deletes the perf log test temp directory on fixture construction to avoid stale state across CI runs. |
src/test/app/TxQ_test.cpp |
Replaces a strict “no extra serverStatus” assertion with a drain loop to tolerate asynchronous extra messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7005 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 1010 1010
Lines 76383 76383
Branches 7530 7530
=======================================
+ Hits 62522 62523 +1
+ Misses 13861 13860 -1 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| using namespace boost::filesystem; | ||
| boost::system::error_code ec; | ||
| remove_all(logDir(), ec); |
There was a problem hiding this comment.
Can't we use std::filesystem::remove_all?
There was a problem hiding this comment.
The rest of the file uses boost::filesystem throughout (path, exists, remove, create_directories, permissions, etc.). Using std::filesystem just for this one call would be inconsistent. Switching the whole file to std::filesystem would be a separate refactor.
There was a problem hiding this comment.
Ah, thanks. It would be great if you made a refactoring PR after this PR is merged.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
High Level Overview of Change
This PR fixes flaky tests in
TxQandPerfLog.Note: these changes were vibe coded, as are all comment replies, so they should be reviewed carefully. They do not touch source code though, so the risk is low.
Context of Change
These tests suddenly started getting flaky a day or two ago
API Impact
N/A