Skip to content

Commit c1770b4

Browse files
committed
roachprod: reset VM shuffle stop order
Epic: None Release note: None
1 parent a67cc34 commit c1770b4

File tree

1 file changed

+5
-4
lines changed
  • pkg/roachprod/failureinjection/failures

1 file changed

+5
-4
lines changed

pkg/roachprod/failureinjection/failures/reset.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package failures
77

88
import (
99
"context"
10-
"slices"
10+
"math/rand"
1111
"time"
1212

1313
"github.com/cockroachdb/cockroach/pkg/roachprod"
@@ -87,11 +87,12 @@ func (m *processMap) getStartOrder() []string {
8787
return order
8888
}
8989

90-
// getStopOrder returns the order in which the processes should be stopped. It
91-
// is the reverse of the start order.
90+
// getStopOrder returns the order in which the processes should be stopped.
9291
func (m *processMap) getStopOrder() []string {
9392
order := m.getStartOrder()
94-
slices.Reverse(order)
93+
rand.Shuffle(len(order), func(i, j int) {
94+
order[i], order[j] = order[j], order[i]
95+
})
9596
return order
9697
}
9798

0 commit comments

Comments
 (0)