Skip to content

Commit 1579396

Browse files
committed
Only switch off pushback once we know that we are not pushing anything else
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 5710273 commit 1579396

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/queue/queue_disk_channel_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ func TestPersistableChannelQueue_Pause(t *testing.T) {
207207
log.Info("pausing")
208208
pausable.Pause()
209209
}
210-
pushBack = false
211210
lock.Unlock()
212211
return data
213212
}
@@ -333,6 +332,10 @@ func TestPersistableChannelQueue_Pause(t *testing.T) {
333332
return
334333
}
335334

335+
lock.Lock()
336+
pushBack = false
337+
lock.Unlock()
338+
336339
pausable.Resume()
337340

338341
_, resumed = pausable.IsPausedIsResumed()
@@ -451,6 +454,10 @@ func TestPersistableChannelQueue_Pause(t *testing.T) {
451454
default:
452455
}
453456

457+
lock.Lock()
458+
pushBack = false
459+
lock.Unlock()
460+
454461
pausable.Resume()
455462
_, resumed = pausable.IsPausedIsResumed()
456463
select {

0 commit comments

Comments
 (0)