add more slack to test_recheck, as it has been failing on and off on travis

This commit is contained in:
arvidn 2016-03-02 21:35:08 -05:00
parent 2e3be6e5ca
commit 84eafac1e2
1 changed files with 10 additions and 1 deletions

View File

@ -55,12 +55,20 @@ const int mask = alert::all_categories & ~(alert::performance_warning | alert::s
void wait_for_complete(lt::session& ses, torrent_handle h) void wait_for_complete(lt::session& ses, torrent_handle h)
{ {
for (int i = 0; i < 70; ++i) int last_progress = 0;
clock_type::time_point last_change = clock_type::now();
for (int i = 0; i < 400; ++i)
{ {
print_alerts(ses, "ses1"); print_alerts(ses, "ses1");
torrent_status st = h.status(); torrent_status st = h.status();
fprintf(stderr, "%f %%\n", st.progress_ppm / 10000.f); fprintf(stderr, "%f %%\n", st.progress_ppm / 10000.f);
if (st.progress_ppm == 1000000) return; if (st.progress_ppm == 1000000) return;
if (st.progress_ppm != last_progress)
{
last_progress = st.progress_ppm;
last_change = clock_type::now();
}
if (clock_type::now() - last_change > seconds(10)) break;
test_sleep(500); test_sleep(500);
} }
TEST_ERROR("torrent did not finish"); TEST_ERROR("torrent did not finish");
@ -107,3 +115,4 @@ TORRENT_TEST(recheck)
TEST_CHECK(st1.progress_ppm <= 1000000); TEST_CHECK(st1.progress_ppm <= 1000000);
wait_for_complete(ses1, tor1); wait_for_complete(ses1, tor1);
} }