lib/model: Remove some testing deadlocks (#6138)
This commit is contained in:
@@ -253,8 +253,22 @@ func TestCopierFinder(t *testing.T) {
|
||||
|
||||
f.handleFile(requiredFile, copyChan, dbUpdateChan)
|
||||
|
||||
pulls := []pullBlockState{<-pullChan, <-pullChan, <-pullChan, <-pullChan}
|
||||
finish := <-finisherChan
|
||||
timeout := time.After(10 * time.Second)
|
||||
pulls := make([]pullBlockState, 4)
|
||||
for i := 0; i < 4; i++ {
|
||||
select {
|
||||
case pulls[i] = <-pullChan:
|
||||
case <-timeout:
|
||||
t.Fatalf("Timed out before receiving all 4 states on pullChan (already got %v)", i)
|
||||
}
|
||||
}
|
||||
var finish *sharedPullerState
|
||||
select {
|
||||
case finish = <-finisherChan:
|
||||
case <-timeout:
|
||||
t.Fatal("Timed out before receiving 4 states on pullChan")
|
||||
}
|
||||
|
||||
defer cleanupSharedPullerState(finish)
|
||||
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user