Skip to content

Commit

Permalink
simplify rng for conflict and unique perm
Browse files Browse the repository at this point in the history
  • Loading branch information
wlawt committed Apr 17, 2024
1 parent dda4322 commit aae39a8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,7 @@ func TestLargeRandomReadsAndWrites(t *testing.T) {
// add the random keys to tx
for k := range randomConflictingKeys {
// randomly pick if conflict key is Read/Write
conflictMode := rand.Intn(2) //nolint:gosec
switch conflictMode {
switch rand.Intn(2) { //nolint:gosec
case 0:
s.Add(conflictKeys[k], state.Read)
case 1:
Expand All @@ -890,8 +889,7 @@ func TestLargeRandomReadsAndWrites(t *testing.T) {
remaining := numKeys - setSize
for j := 0; j < remaining; j++ {
// randomly pick the permission for unique keys
uniqueMode := rand.Intn(2) //nolint:gosec
switch uniqueMode {
switch rand.Intn(2) { //nolint:gosec
case 0:
s.Add(ids.GenerateTestID().String(), state.Read)
case 1:
Expand Down

0 comments on commit aae39a8

Please sign in to comment.