Skip to content

Commit 87df5c1

Browse files
donislawdevclaude
andcommitted
TEMPORARY: a data race on purpose, to see one race part go red
Reverted by the next commit, before merging. Expected: the part holding TestADataRaceOnPurposeForTheRaceJob (part 0 by the sorted list) red with DATA RACE, parts 1 to 3 green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 818d0d2 commit 87df5c1

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎internal/guard/mutationcoverage_test.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ import (
3232
// means saying out loud that a guard is unproven. The list should only ever get
3333
// shorter.
3434
var notProvenByMutation = map[string]bool{
35+
// A data race on purpose, to see one part of the race job go red. It has
36+
// no line of ours to break and is reverted before merging.
37+
"TestADataRaceOnPurposeForTheRaceJob": true,
3538
// A directory entry costs one tar block and nothing more.
3639
//
3740
// There is no line of ours under this one to break. It asserts what

‎internal/guard/raceprobe_test.go‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package guard
2+
3+
import "testing"
4+
5+
// A data race put here on purpose, for one pull request only: the part of the
6+
// race detector job that holds this test has to go red, and the other parts
7+
// green. Reverted by the next commit, before the pull request is merged.
8+
func TestADataRaceOnPurposeForTheRaceJob(t *testing.T) {
9+
n := 0
10+
done := make(chan struct{})
11+
go func() {
12+
n++
13+
close(done)
14+
}()
15+
n++
16+
<-done
17+
if n != 2 {
18+
t.Logf("the two increments landed as %d", n)
19+
}
20+
}

0 commit comments

Comments
 (0)