fs/torrentfs_test.go | 13 ++++++------- diff --git a/fs/torrentfs_test.go b/fs/torrentfs_test.go index a3297455627b3ed54923c48a13843357cd691948..369071e98c21355efe3bc5d03a082bdbfdd3424f 100644 --- a/fs/torrentfs_test.go +++ b/fs/torrentfs_test.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "io/ioutil" - "log" "net" "net/http" _ "net/http/pprof" @@ -13,6 +12,7 @@ "path/filepath" "strconv" "strings" "testing" + "time" "bitbucket.org/anacrolix/go.torrent" "bitbucket.org/anacrolix/go.torrent/testutil" @@ -73,7 +73,6 @@ name := testutil.CreateDummyTorrentData(tl.Completed) metaInfoBuf := &bytes.Buffer{} testutil.CreateMetaInfo(name, metaInfoBuf) tl.Metainfo, err = metainfo.Load(metaInfoBuf) - log.Printf("%x", tl.Metainfo.Info.Pieces) return } @@ -98,7 +97,6 @@ NoDefaultBlocklist: true, }) defer client.Stop() - t.Logf("%+v", *layout.Metainfo) client.AddTorrent(layout.Metainfo) fs := New(client) fuseConn, err := fuse.Mount(layout.MountDir) @@ -108,10 +106,6 @@ t.Skip(err) } t.Fatal(err) } - <-fuseConn.Ready - if err := fuseConn.MountError; err != nil { - t.Fatal(err) - } go func() { server := fusefs.Server{ FS: fs, @@ -121,6 +115,10 @@ }, } server.Serve(fuseConn) }() + <-fuseConn.Ready + if err := fuseConn.MountError; err != nil { + t.Fatal(err) + } // Read the greeting file, though it will never be available. This should // "wedge" FUSE, requiring the fs object to be forcibly destroyed. The // read call will return with a FS error. @@ -144,6 +142,7 @@ for { err = fuse.Unmount(layout.MountDir) if err != nil { t.Logf("error unmounting: %s", err) + time.Sleep(time.Millisecond) } else { break }