Avoid race condition in test
This commit is contained in:
parent
17ea4f7fdd
commit
083d2120f3
|
@ -112,7 +112,9 @@ func TestTorrentInitialState(t *testing.T) {
|
|||
tor.storageOpener = storage.NewClient(storage.NewFileWithCompletion("/dev/null", storage.NewMapPieceCompletion()))
|
||||
// Needed to lock for asynchronous piece verification.
|
||||
tor.cl = new(Client)
|
||||
tor.cl.mu.Lock()
|
||||
err := tor.setInfoBytes(mi.InfoBytes)
|
||||
tor.cl.mu.Unlock()
|
||||
require.NoError(t, err)
|
||||
require.Len(t, tor.pieces, 3)
|
||||
tor.pendAllChunkSpecs(0)
|
||||
|
|
Loading…
Reference in New Issue