Skip to content

Commit

Permalink
Fixing condition in regression test
Browse files Browse the repository at this point in the history
Fixing wrong comparison, the time taken should be less than a second, not more.
  • Loading branch information
Thomas Heller committed Jun 28, 2017
1 parent a80816f commit 00a9882
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/regressions/lcos/wait_for_1751.cpp
Expand Up @@ -17,24 +17,25 @@ int hpx_main()
{
auto overall_start_time = std::chrono::high_resolution_clock::now();

while(true)
while (true)
{
auto start_time = std::chrono::high_resolution_clock::now();

// run for 3 seconds max
std::chrono::duration<double> overall_dif = start_time - overall_start_time;
std::chrono::duration<double> overall_dif =
start_time - overall_start_time;
if (overall_dif.count() > 3.0)
break;

auto f = hpx::async([](){});
auto f = hpx::async([]() {});

if (f.wait_for(std::chrono::seconds(1)) ==
hpx::lcos::future_status::timeout)
hpx::lcos::future_status::timeout)
{
auto now = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> dif = now - start_time;

HPX_TEST_LTE(1.0, dif.count());
HPX_TEST_LTE(dif.count(), 1.0);
break;
}
else
Expand Down

0 comments on commit 00a9882

Please sign in to comment.