mirror of
https://github.com/transmission/transmission
synced 2025-02-21 13:46:52 +00:00
test: fix race condition in rename-test (#2612)
This commit is contained in:
parent
2410ad2fa6
commit
cddd400f7e
2 changed files with 8 additions and 1 deletions
|
@ -102,6 +102,7 @@ static bool verifyTorrent(tr_torrent* tor, bool const* stopFlag)
|
|||
changed |= hasPiece != hadPiece;
|
||||
}
|
||||
|
||||
tor->checked_pieces_.set(piece, true);
|
||||
tor->markChanged();
|
||||
|
||||
/* sleeping even just a few msec per second goes a long
|
||||
|
|
|
@ -437,7 +437,13 @@ protected:
|
|||
EXPECT_FALSE(tr_amInEventThread(tor->session));
|
||||
tr_torrentVerify(tor);
|
||||
tr_wait_msec(100);
|
||||
EXPECT_TRUE(waitFor([tor]() { return tor->verifyState == TR_VERIFY_NONE; }, 4000));
|
||||
EXPECT_TRUE(waitFor(
|
||||
[tor]()
|
||||
{
|
||||
auto const activity = tr_torrentGetActivity(tor);
|
||||
return activity != TR_STATUS_CHECK && activity != TR_STATUS_CHECK_WAIT && tor->checked_pieces_.hasAll();
|
||||
},
|
||||
4000));
|
||||
}
|
||||
|
||||
tr_session* session_ = nullptr;
|
||||
|
|
Loading…
Reference in a new issue