Skip to content

Commit 6ef9d67

Browse files
committed
tests/unit-test-client.c: sleep more and flush again before the "7ms > 5ms" test case
It fails or passes randomly on different platforms Win32/mingw, FreeBSD, MacOS X maybe something remains in buffer? We'll see if extra sleep helps. Signed-off-by: Jim Klimov <[email protected]>
1 parent 3284e28 commit 6ef9d67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/unit-test-client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,9 @@ int main(int argc, char *argv[])
730730
/* Wait remaining bytes before flushing */
731731
usleep(11 * 5000);
732732
modbus_flush(ctx);
733+
/* ...and then some, just in case (e.g. kernel delays, clock jitter, multi-CPU...) */
734+
usleep(11 * 5000);
735+
modbus_flush(ctx);
733736

734737
/* Timeout of 7ms between bytes */
735738
TEST_TITLE("2/2 Adapted byte timeout (7ms > 5ms)");

0 commit comments

Comments
 (0)