Skip to content

Commit

Permalink
tests: settings: delay after connection for log flush
Browse files Browse the repository at this point in the history
When registering settings during the HIL test, we get a flood
of log messages. On some platforms this can overwhelm the log
buffer and lead to dropped messages. If one of those dropped
messages is the connection message that the test scripts wait
for, the test will fail. Adding a small delay between the
connection to Golioth and registering the settings will give time
for the log buffer to flush, ensuring the test script receives the
connection message, and increasing the stability of the test.

Signed-off-by: Sam Friedman <[email protected]>
  • Loading branch information
sam-golioth committed Jan 29, 2025
1 parent 88ff1db commit 679e661
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/hil/tests/settings/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ void hil_test_entry(const struct golioth_client_config *config)

golioth_sys_sem_take(connected_sem, GOLIOTH_SYS_WAIT_FOREVER);

/* Allow log buffer to clear before registering settings */

golioth_sys_msleep(5 * 1000);

struct golioth_settings *settings = perform_settings_registration(client);

while (1)
Expand Down

0 comments on commit 679e661

Please sign in to comment.