fix(tests): improve signal handling and error reporting in lock tests#622
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the lock-related test suite to make interrupt handling more consistent across platforms and to improve diagnostics/behavior when the helper process exits unexpectedly.
Changes:
- Wrap
TestBackupWithResticLockFailureRetriedinsynctest.Testto better control timing-related behavior. - Update the lock helper program to only handle
os.Interruptand adjust signal setup. - Improve lock tests’ interrupt signaling and add
isSignalErrorto skip an “inconclusive” run when the child process appears to have been terminated by a signal.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| wrapper_test.go | Uses testing/synctest to make the “lock failure retried” test less timing-sensitive. |
| lock/test/main.go | Changes how the helper binary registers/ignores signals, focusing on os.Interrupt. |
| lock/lock_test.go | Sends os.Interrupt instead of SIGINT and adds isSignalError to improve error handling/skip logic in flaky scenarios. |
💡 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 @@
## master #622 +/- ##
=======================================
Coverage 80.76% 80.76%
=======================================
Files 164 164
Lines 12116 12116
=======================================
Hits 9785 9785
Misses 1836 1836
Partials 495 495
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
No description provided.