diff --git a/tests/suites/test_suite_platform.data b/tests/suites/test_suite_platform.data index 39b423f3dd..4276b8fb77 100644 --- a/tests/suites/test_suite_platform.data +++ b/tests/suites/test_suite_platform.data @@ -4,6 +4,3 @@ time_get_milliseconds: Time: get seconds time_get_seconds: - -Time: delay milliseconds -time_delay_milliseconds:1000 diff --git a/tests/suites/test_suite_platform.function b/tests/suites/test_suite_platform.function index 7453c32c9c..61681b8789 100644 --- a/tests/suites/test_suite_platform.function +++ b/tests/suites/test_suite_platform.function @@ -10,7 +10,8 @@ #if defined(MBEDTLS_HAVE_TIME) #include "mbedtls/platform_time.h" -#ifdef WIN32 +#if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || \ + defined(__MINGW32__) || defined(_WIN64) #include #elif _POSIX_C_SOURCE >= 199309L #include @@ -19,7 +20,8 @@ #endif void sleep_ms(int milliseconds) { -#ifdef WIN32 +#if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || \ + defined(__MINGW32__) || defined(_WIN64) Sleep(milliseconds); #elif _POSIX_C_SOURCE >= 199309L struct timespec ts; @@ -64,6 +66,13 @@ void time_delay_milliseconds(int delay_ms) mbedtls_ms_time_t current = mbedtls_ms_time(); mbedtls_ms_time_t elapsed_ms; + /* + * WARNING: DO NOT ENABLE THIS TEST. We keep the code here to document the + * reason. + * + * Windows CI reports random test fail on platform-suite. It might + * be caused by this case. + */ sleep_ms(delay_ms); elapsed_ms = mbedtls_ms_time() - current;