Skip to content

Commit

Permalink
Merge pull request #19404 from tschottdorf/no-livelock-for
Browse files Browse the repository at this point in the history
storage: de-flake TestRefreshPendingCommands
  • Loading branch information
tbg authored Oct 20, 2017
2 parents 67c5436 + 1b44843 commit 3b7e1fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/storage/client_raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,14 @@ func TestRefreshPendingCommands(t *testing.T) {
for i := 0; i < 2; i++ {
draining = draining && mtc.stores[i].IsDraining()
}
// If this goroutine can't be preempted, and we don't have other threads
// available (for example since you only have four and the other three
// are in GC, or you even only have one to begin with!), it can end up
// spinning forever. In the case that prompted adding this, there are
// four cores and "gc assist" got us stuck.
//
// See #18554.
time.Sleep(time.Nanosecond)
}
mtc.advanceClock(context.Background())

Expand Down

0 comments on commit 3b7e1fa

Please sign in to comment.