]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Probably fix test failure
authorMatt Joiner <anacrolix@gmail.com>
Thu, 12 May 2016 02:44:51 +0000 (12:44 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 12 May 2016 02:44:51 +0000 (12:44 +1000)
Due to some changes in the Torrent instantiation code, I think there's a race in this test to verify the piece before counting the pending chunks. The torrent isn't supposed to be complete to begin with, so give it a bogus data directory to ensure it.

client_test.go

index dfbcbbac928e224f6726fd559fa663e81fb93ae2..c87eafd9da4524427d16ed5b50f4ac9cb03fac67 100644 (file)
@@ -90,7 +90,7 @@ func TestTorrentInitialState(t *testing.T) {
                pieceStateChanges: pubsub.NewPubSub(),
        }
        tor.chunkSize = 2
-       tor.storageOpener = storage.NewFile(dir)
+       tor.storageOpener = storage.NewFile("/dev/null")
        // Needed to lock for asynchronous piece verification.
        tor.cl = new(Client)
        err := tor.setInfoBytes(mi.Info.Bytes)