diff options
author | Rob Barnes <robbarnes@google.com> | 2022-11-08 17:56:13 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-11-09 14:42:48 +0000 |
commit | e615a219c1694276467dbfc5c0874ae50895ccb0 (patch) | |
tree | 0544bbcf6e8f874c73a2b8f45beaa387c58dfefe | |
parent | 0a4c660df17d5d41afe00b3e64dda9c4510c0319 (diff) | |
download | chrome-ec-e615a219c1694276467dbfc5c0874ae50895ccb0.tar.gz |
test/kb_scan: Add 1ms delay at the beginning of each test step
There's a race condition between this test and system init.
Specifically, calling weak functions during system init can cause
kb_scan test to fail.
I don't fully understand the source of the race condition, but
adding just a 1ms delay at the beginning of each test step
resolves the issue.
BUG=b:258231435
BRANCH=None
TEST=kb_scan and kb_scan_strict pass on host
Change-Id: I624d4f62533d25fb128ab6f39408fd643c2fa869
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4012962
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r-- | test/kb_scan.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/kb_scan.c b/test/kb_scan.c index 82693ff525..031c972d0e 100644 --- a/test/kb_scan.c +++ b/test/kb_scan.c @@ -578,6 +578,7 @@ static void run_test_step1(void) lid_open = 1; hook_notify(HOOK_LID_CHANGE); test_reset(); + msleep(1); RUN_TEST(deghost_test); @@ -606,6 +607,7 @@ static void run_test_step2(void) lid_open = 1; hook_notify(HOOK_LID_CHANGE); test_reset(); + msleep(1); RUN_TEST(test_check_boot_esc); @@ -620,6 +622,7 @@ static void run_test_step3(void) lid_open = 1; hook_notify(HOOK_LID_CHANGE); test_reset(); + msleep(1); RUN_TEST(test_check_boot_down); |