Skip to content

Commit

Permalink
CI: change sleep_test() and timestamp_test() to exclusive on Windows (#…
Browse files Browse the repository at this point in the history
…4246)

* Set sleep_test() as exclusive on Windows. Also set exclusive tests to run last for slightly more efficient testing time

* Also changed timestamp_test() to exclusive as well because it often drifts on GH Windows CI
  • Loading branch information
bennylp authored Jan 10, 2025
1 parent 6853491 commit 2d4b94a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion pjlib/src/pjlib-test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,18 @@ static int features_tests(int argc, char *argv[])
UT_ADD_TEST(&test_app.ut_app, hash_test, 0);
#endif

/* Windows GH CI oftent fails with:
07:27:13.217 ...testing frequency accuracy (pls wait)
07:27:23.440 ....error: timestamp drifted by 3800 usec after 10020 msec
*/
#if INCLUDE_TIMESTAMP_TEST
# if defined(PJ_WIN32) && PJ_WIN32!=0
UT_ADD_TEST(&test_app.ut_app, timestamp_test,
PJ_TEST_EXCLUSIVE | PJ_TEST_KEEP_LAST);
# else
UT_ADD_TEST(&test_app.ut_app, timestamp_test, 0);
# endif
#endif

#if INCLUDE_ATOMIC_TEST
Expand All @@ -254,8 +264,17 @@ static int features_tests(int argc, char *argv[])
UT_ADD_TEST(&test_app.ut_app, timer_test, 0);
#endif

/* Very often sleep test failed on GitHub Windows CI, with
the thread sleeping for much longer than tolerated. So
as a workaround, set it as exclusive.
*/
#if INCLUDE_SLEEP_TEST
# if defined(PJ_WIN32) && PJ_WIN32!=0
UT_ADD_TEST(&test_app.ut_app, sleep_test,
PJ_TEST_EXCLUSIVE | PJ_TEST_KEEP_LAST);
# else
UT_ADD_TEST(&test_app.ut_app, sleep_test, 0);
# endif
#endif

#if INCLUDE_FILE_TEST
Expand Down Expand Up @@ -299,7 +318,8 @@ static int features_tests(int argc, char *argv[])
*/
#if INCLUDE_IOQUEUE_STRESS_TEST
# if defined(PJ_WIN32) && PJ_WIN32!=0
UT_ADD_TEST(&test_app.ut_app, ioqueue_stress_test, PJ_TEST_EXCLUSIVE);
UT_ADD_TEST(&test_app.ut_app, ioqueue_stress_test,
PJ_TEST_EXCLUSIVE | PJ_TEST_KEEP_LAST);
# else
UT_ADD_TEST(&test_app.ut_app, ioqueue_stress_test, 0);
# endif
Expand Down

0 comments on commit 2d4b94a

Please sign in to comment.