forked from premiere/premiere-libtorrent
make test_transfer much more likely to succeed
This commit is contained in:
parent
2a3f4e2360
commit
34b83ddd71
|
@ -128,6 +128,7 @@ int main()
|
|||
#else
|
||||
chdir(dir);
|
||||
#endif
|
||||
fprintf(stderr, "cwd = \"%s\"\n", test_dir.c_str());
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
try
|
||||
|
|
|
@ -309,6 +309,13 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
|||
{
|
||||
test_disk_full = false;
|
||||
((test_storage*)tor2.get_storage_impl())->m_limit = 16 * 1024 * 1024;
|
||||
|
||||
// if we reset the upload mode too soon, there may be more disk
|
||||
// jobs failing right after, putting us back in upload mode. So,
|
||||
// give the disk some time to fail all disk jobs before resetting
|
||||
// upload mode to false
|
||||
test_sleep(500);
|
||||
|
||||
tor2.set_upload_mode(false);
|
||||
TEST_CHECK(tor2.status().is_finished == false);
|
||||
TEST_EQUAL(peer_disconnects, 2);
|
||||
|
|
Loading…
Reference in New Issue