Skip to content

Commit

Permalink
[tests] Use an async wait instead of Thread.Sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcgovern committed May 25, 2020
1 parent c845c63 commit c4b1460
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ internal async Task SendMetadataCore (string expectedPath, PeerMessage sendAfter
}

// We've sent all the pieces. Now we just wait for the torrentmanager to process them all.
while (rig.Manager.Mode is MetadataMode)
System.Threading.Thread.Sleep (10);
await rig.Manager.WaitForState (TorrentState.Downloading).WithTimeout ();

Assert.IsTrue (File.Exists (expectedPath), "#1");
Torrent torrent = Torrent.Load (expectedPath);
Expand Down

0 comments on commit c4b1460

Please sign in to comment.