Fix flaky TestReadersWritersStress: nil guards and longer WaitGroup timeouts#2073
Fix flaky TestReadersWritersStress: nil guards and longer WaitGroup timeouts#2073asmyasnikov with Copilot wants to merge 4 commits into
Conversation
…p timeouts Agent-Logs-Url: https://github.com/ydb-platform/ydb-go-sdk/sessions/b5caee50-86a1-4365-9274-da0c4888c00d Co-authored-by: asmyasnikov <14202262+asmyasnikov@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ydb-platform/ydb-go-sdk/sessions/b5caee50-86a1-4365-9274-da0c4888c00d Co-authored-by: asmyasnikov <14202262+asmyasnikov@users.noreply.github.com>
AI Review SummaryVerdict: ✅ No critical issues found Critical issuesNo critical issues found. Other findingsNone. This review was generated automatically. Critical issues require attention; other findings are advisory. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes intermittent TestReadersWritersStress failures by preventing nil dereference panics in deferred cleanup and by increasing stress-test shutdown wait time to better match CI conditions.
Changes:
- Add nil guards before calling
Close()in writer/reader deferred cleanup to avoid panics whenStartWriter/StartReaderfails. - Replace short
xtest.WaitGroupwaits withxtest.WaitGroupWithTimeout(..., time.Minute)for more reliable stress-test teardown.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
summaryInferred base version: v3.135.10 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2073 +/- ##
==========================================
- Coverage 75.16% 74.97% -0.20%
==========================================
Files 427 427
Lines 36974 36974
==========================================
- Hits 27792 27721 -71
- Misses 7993 8057 +64
- Partials 1189 1196 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
TestReadersWritersStressfails intermittently due to two bugs instressTestInATopic.Nil pointer dereference on StartWriter/StartReader failure
writeToTopicandreadFromTopicdeclaredwriter/readerasnilbefore thedefer, then calledCloseunconditionally. Any transient error fromStartWriter/StartReaderwould trigger a nil dereference panic in the deferred cleanup.WaitGroup timeout too short for stress test cleanup
xtest.WaitGroupusescommonWaitTimeout = 1s. After stopping writers/readers, cleanup involves closing gRPC streams and flushing buffers—operations that routinely exceed 1s under CI load. Replaced bothxtest.WaitGroupcalls withxtest.WaitGroupWithTimeout(..., time.Minute), consistent with thetime.Minutealready used forSpinWaitProgressWithTimeoutin the same function.