Skip to content

Commit

Permalink
hil: ota: adjust delays to reduce false negative
Browse files Browse the repository at this point in the history
When testing reason and state codes, propagation delay from the device to
the server were causing erroneous test failures. This increases the delay
before checking the updated server value, and also increases the device
delay between sending reason/state updates. The marginal difference is 2s
per reason code, or 20 seconds total increase in test time.

Signed-off-by: Mike Szczys <mike@golioth.io>
  • Loading branch information
szczys committed May 7, 2024
1 parent e4b2ff6 commit 4f1e82f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/hil/tests/ota/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void test_reason_and_state(void)
{
GLTH_LOGE(TAG, "Unable to report ota state: %d", status);
}
golioth_sys_msleep(5000);
golioth_sys_msleep(7000);
}

GLTH_LOGI(TAG, "golioth_ota_get_state: %d", golioth_ota_get_state());
Expand Down
4 changes: 2 additions & 2 deletions tests/hil/tests/ota/test_ota.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ async def test_reason_and_state(board, device, project, releases):
# Test reason and state code updates

for i, r in enumerate(golioth_ota_reason):
board.wait_for_regex_in_line("Updating status", timeout_s=12)
time.sleep(1.5) # Wait for server to propagate
board.wait_for_regex_in_line("Updating status", timeout_s=20)
time.sleep(3) # Wait for server to propagate

await device.refresh()

Expand Down

0 comments on commit 4f1e82f

Please sign in to comment.