Skip to content

Commit

Permalink
test: Ensure test_scheduler_drift_accumulation takes enough time
Browse files Browse the repository at this point in the history
In some rare cases executing the queries present in this test
takes less than a millisecond each, so no drift is accumulated.
Add a query which always takes at least 1 second to avoid flakyness.
  • Loading branch information
Smjert committed Jul 3, 2024
1 parent 961c36c commit b49ee8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion osquery/dispatcher/tests/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ TEST_F(SchedulerTests, test_scheduler_drift_accumulation) {
"6": {"query": "select 6 as number", "interval": 1},
"7": {"query": "select 7 as number", "interval": 1},
"8": {"query": "select 1 as number", "interval": 1},
"9": {"query": "select 2 as number", "interval": 1}
"9": {"query": "select 2 as number", "interval": 1},
"10": {"query": "select sleep(1)", "interval": 1}
}
}
}
Expand Down

0 comments on commit b49ee8a

Please sign in to comment.