Fix race in TestPartitionReplicationRequestLoopPreempt
Fix a race condition in TestPartitionReplicationRequestLoopPreempt which
caused the test to sporadically fail. This was caused by a race between
a NATS subscription getting created and a message getting published.
This is fixed by adding a flush call after subscribing.
@@ -542,6 +542,7 @@ func TestPartitionReplicationRequestLoopPreempt(t *testing.T) {
requests <- struct{}{}
})
require.NoError(t, err)
+ require.NoError(t, nc.Flush())
stop := make(chan struct{})
defer close(stop)
