[Testing] Add regression tests for network data race fixes - #8635
[Testing] Add regression tests for network data race fixes#8635janezpodhostnik wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
| wg.Add(2) | ||
|
|
||
| // writer: repeatedly updates the same peer's score. | ||
| go func() { | ||
| defer wg.Done() |
There was a problem hiding this comment.
Maybe use WaitGroup.Go for new code instead of the manual dance
Adds deterministic regression coverage for the network-layer race fixes from #8633. Each new test was verified to fail (assertion failure or
-racereport) with the corresponding fix reverted, and to pass with it.Changes
network/slashing: first tests for the package. Verify the violations consumer does not mutate the caller'sViolationand that one violation can be reported concurrently through all entry points.SpamRecordCache: same-record concurrentGet/AdjustWithInittest. The existing concurrency tests only exercised disjoint records and did not catch the race. Also verifies the returned penalty is the one produced by the caller's own adjustment.AppSpecificScoreCache: same-peer concurrent update/read test, for the same reason.Related: #8633
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.