summaryrefslogtreecommitdiff
path: root/test/stillness_detector.c
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-05-31 16:55:04 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-01 20:17:31 +0000
commit243ec6c7ab5b93dd70193b7716c8875eb4fb18f9 (patch)
treebdf7edf4bcc6d81f39859de0aaf2977275cdbf0c /test/stillness_detector.c
parent19591c8d7108389c2e6339f016f9a70e4817e86c (diff)
downloadchrome-ec-243ec6c7ab5b93dd70193b7716c8875eb4fb18f9.tar.gz
ec: Add sleep in stillness_detector test
Sometimes some of the background tasks, that don't affect test results, haven't even started or are still doing their initialization at the end of the test. Wait a short time (2s was determined through trial and error) before printing the test results. This should cause the test to emit a consistent number of lines in the coverage report. BRANCH=None BUG=b:213374060,b:234225228 TEST=Ran this command many times make clobber ; \ make TEST_COVERAGE=y build/coverage/stillness_detector.info \ >&/dev/null && lcov --summary build/coverage/stillness_detector.info \ && lcov --list build/coverage/stillness_detector.info \ | grep common/mkbp_event.c Change-Id: Ic889dfa55ed8f8dba3e26ef94c85c760ed47037b Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3681941 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'test/stillness_detector.c')
-rw-r--r--test/stillness_detector.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/stillness_detector.c b/test/stillness_detector.c
index e881525491..57057e217e 100644
--- a/test/stillness_detector.c
+++ b/test/stillness_detector.c
@@ -135,5 +135,7 @@ void run_test(int argc, char **argv)
RUN_TEST(test_not_still_one_axis);
RUN_TEST(test_resets);
+ /* Wait for all background tasks to start. */
+ sleep(2);
test_print_result();
}