mirror of
https://github.com/gperftools/gperftools
synced 2025-01-18 04:41:34 +00:00
fix flakiness of profile-handler_unittest
When checking if timer is enabled, we should look at it_interval.
This commit is contained in:
parent
5ba98e397c
commit
55d559f7c9
@ -130,14 +130,8 @@ void Delay(int delay_ns) {
|
||||
bool IsTimerEnabled() {
|
||||
itimerval current_timer;
|
||||
EXPECT_EQ(0, getitimer(timer_type_, ¤t_timer));
|
||||
if ((current_timer.it_value.tv_sec == 0) &&
|
||||
(current_timer.it_value.tv_usec != 0)) {
|
||||
// May be the timer has expired. Sleep for a bit and check again.
|
||||
Delay(kTimerResetInterval);
|
||||
EXPECT_EQ(0, getitimer(timer_type_, ¤t_timer));
|
||||
}
|
||||
return (current_timer.it_value.tv_sec != 0 ||
|
||||
current_timer.it_value.tv_usec != 0);
|
||||
return (current_timer.it_interval.tv_sec != 0 ||
|
||||
current_timer.it_interval.tv_usec != 0);
|
||||
}
|
||||
|
||||
// Dummy worker thread to accumulate cpu time.
|
||||
|
Loading…
Reference in New Issue
Block a user