소스 검색

ci: fix random unit test CI failure:

we use `-` command to check if DUT reset pass. If we input `-` command
during DUT bootup, DUT could only receive `\n` and print test cases.
Print test cases could take long time and lead to reset check timeout.
Now we will add delay after reset, and enlarge reset check timeout to
solve this problem.
He Yin Ling 6 년 전
부모
커밋
304e7119ce
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      tools/unit-test-app/unit_test.py

+ 7 - 1
tools/unit-test-app/unit_test.py

@@ -63,8 +63,9 @@ MULTI_DEVICE_ID = 2
 
 DEFAULT_TIMEOUT = 20
 
+DUT_DELAY_AFTER_RESET = 2
 DUT_STARTUP_CHECK_RETRY_COUNT = 5
-TEST_HISTORY_CHECK_TIMEOUT = 1
+TEST_HISTORY_CHECK_TIMEOUT = 2
 
 
 class TestCaseFailed(AssertionError):
@@ -164,6 +165,11 @@ def reset_dut(dut):
     # now use input cmd `-` and check test history to check if DUT is bootup.
     # we'll retry this step for a few times,
     # in case `dut.reset` returns during DUT bootup (when DUT can't process any command).
+    #
+    # during bootup, DUT might only receive part of the first `-` command.
+    # If it only receive `\n`, then it will print all cases. It could take more than 5 seconds, reset check will fail.
+    # To solve this problem, we will add a delay between reset and input `-` command. And we'll also enlarge expect timeout.
+    time.sleep(DUT_DELAY_AFTER_RESET)
     for _ in range(DUT_STARTUP_CHECK_RETRY_COUNT):
         dut.write("-")
         try: