From 16966c0b28022e09e933a78b527917534d621fe9 Mon Sep 17 00:00:00 2001 From: "Hui, Chunyang" Date: Mon, 18 Oct 2021 03:37:27 +0000 Subject: [PATCH] Fix sysinfo and env test case failure in stress test --- test/env/main.c | 2 +- test/sysinfo/main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/env/main.c b/test/env/main.c index bede0e78..f4a15475 100644 --- a/test/env/main.c +++ b/test/env/main.c @@ -209,7 +209,7 @@ int main(int argc, const char *argv[]) { g_argc = argc; g_argv = argv; // Test argc - if (getpid() > 2) { + if (g_argc == 2) { return test_suite_run(child_test_cases, ARRAY_SIZE(child_test_cases)); } else { return test_suite_run(test_cases, ARRAY_SIZE(test_cases)); diff --git a/test/sysinfo/main.c b/test/sysinfo/main.c index 857d6538..e64a5a43 100644 --- a/test/sysinfo/main.c +++ b/test/sysinfo/main.c @@ -31,8 +31,8 @@ int test_sysinfo() { printf ("free RAM: %5.1f MB\n", info.freeram / MEGABYTE); printf ("process count: %d\n", info.procs); - // make sure update is in a valid range (1s ~ 5min) - if (info.uptime < 1 || info.uptime / MIN > 5 ) { + // make sure update is in a valid range ( > 1s) + if (info.uptime < 1) { THROW_ERROR("system uptime error"); }