Skip to content

Commit 64177d1

Browse files
authored
CI test: more lenient timestamp test (#4632)
Currently, the timestamp test in `pjlib-test` only allows a 1 ms drift, whereas CI tests often fail due to drifts of around 5 ms. This patch increases the tolerance to 10 ms.
1 parent 40f6c97 commit 64177d1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pjlib/src/pjlib-test/timestamp.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,18 @@ static int timestamp_accuracy()
8585
if (diff < 0)
8686
diff = -diff;
8787

88+
/* In CI mode, allow max 10 msec mismatch */
89+
if (test_app.param_ci_mode) {
90+
if (diff > (pj_int64_t)(freq.u64 / 100)) {
91+
PJ_LOG(3,(THIS_FILE, "....error: timestamp drifted by %d usec after "
92+
"%d msec",
93+
(pj_uint32_t)(diff * 1000000 / freq.u64),
94+
(int)msec));
95+
return -2001;
96+
}
97+
8898
/* Only allow 1 msec mismatch */
89-
if (diff > (pj_int64_t)(freq.u64 / 1000)) {
99+
} else if (diff > (pj_int64_t)(freq.u64 / 1000)) {
90100
PJ_LOG(3,(THIS_FILE, "....error: timestamp drifted by %d usec after "
91101
"%d msec",
92102
(pj_uint32_t)(diff * 1000000 / freq.u64),

0 commit comments

Comments
 (0)