A bunch of these are slightly racy so they're enclosed in loops. This
particular one, though, changes the Throttle state in ways that
invalidate the asserts. To fix, reset the state before commencing a
rerun.
Signed-off-by: Greg Farnum <greg@inktank.com>
t.join();
- if (!(waited = t.waited))
+ if (!(waited = t.waited)) {
delay *= 2;
+ // undo the changes we made
+ throttle.put(throttle_max / 2);
+ throttle.wait(throttle_max);
+ }
} while(!waited);
-
}
TEST_F(ThrottleTest, destructor) {