mirror of
https://github.com/transmission/transmission
synced 2025-02-22 14:10:34 +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;
|
changed |= hasPiece != hadPiece;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tor->checked_pieces_.set(piece, true);
|
||||||
tor->markChanged();
|
tor->markChanged();
|
||||||
|
|
||||||
/* sleeping even just a few msec per second goes a long
|
/* sleeping even just a few msec per second goes a long
|
||||||
|
|
|
@ -437,7 +437,13 @@ protected:
|
||||||
EXPECT_FALSE(tr_amInEventThread(tor->session));
|
EXPECT_FALSE(tr_amInEventThread(tor->session));
|
||||||
tr_torrentVerify(tor);
|
tr_torrentVerify(tor);
|
||||||
tr_wait_msec(100);
|
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;
|
tr_session* session_ = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue