This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 27ecdd789 testing/ostest: shrink default round-robin getprime test 
duration
27ecdd789 is described below

commit 27ecdd789f3e985f68610ea39c0aa3dcd6000d93
Author: Swatantra Yadav <[email protected]>
AuthorDate: Mon Oct 5 23:09:54 2026 +0530

    testing/ostest: shrink default round-robin getprime test duration
    
    The round-robin scheduler test runs two threads that calculate prime
    numbers up to CONFIG_TESTING_OSTEST_RR_RANGE for 
CONFIG_TESTING_OSTEST_RR_RUNS.
    Using default range of 30,000 and 10 runs requires billions of 
trial-division
    loop iterations, causing OSTest to stall for over 5 minutes on slower 
targets
    such as Cortex-M0/M3 and Raspberry Pi Pico (RP2040).
    
    Restore the default search range to 10,000 (aligning with roundrobin.c
    header notes and documentation in 
Documentation/applications/testing/ostest/)
    and reduce the default number of runs from 10 to 4. This significantly
    reduces runtime while providing sufficient time-sliced context switches
    to reliably verify round-robin scheduling.
    
    Fixes #3620
    
    Signed-off-by: Swatantra Yadav <[email protected]>
---
 testing/ostest/Kconfig      | 8 ++++----
 testing/ostest/roundrobin.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/testing/ostest/Kconfig b/testing/ostest/Kconfig
index 357382463..0317e2368 100644
--- a/testing/ostest/Kconfig
+++ b/testing/ostest/Kconfig
@@ -63,7 +63,7 @@ config TESTING_OSTEST_WQUEUE
 
 config TESTING_OSTEST_RR_RANGE
        int "Round-robin test - end of search range"
-       default 30000
+       default 10000
        range 1 32767
        ---help---
                During round-robin scheduling test two threads are created. 
Each of the threads
@@ -72,11 +72,11 @@ config TESTING_OSTEST_RR_RANGE
 
                This value specifies the end of search range and together with 
number of runs
                allows to configure the length of this test - it should last at 
least a few
-               tens of seconds. Allowed values [1; 32767], default 30000
+               tens of seconds. Allowed values [1; 32767], default 10000
 
 config TESTING_OSTEST_RR_RUNS
        int "Round-robin test - number of runs"
-       default 10
+       default 4
        range 1 32767
        ---help---
                During round-robin scheduling test two threads are created. 
Each of the threads
@@ -86,7 +86,7 @@ config TESTING_OSTEST_RR_RUNS
                This value specifies the number of times the thread searches 
the range for
                prime numbers and together with end of search range allows to 
configure the
                length of this test - it should last at least a few tens of 
seconds. Allowed
-               values [1; 32767], default 10
+               values [1; 32767], default 4
 
 if ARCH_FPU && SCHED_WAITPID
 
diff --git a/testing/ostest/roundrobin.c b/testing/ostest/roundrobin.c
index 86af993b8..49984f2f8 100644
--- a/testing/ostest/roundrobin.c
+++ b/testing/ostest/roundrobin.c
@@ -57,11 +57,11 @@
 #endif
 
 #ifndef CONFIG_TESTING_OSTEST_RR_RUNS
-#  define CONFIG_TESTING_OSTEST_RR_RUNS 10
-#  warning "CONFIG_TESTING_OSTEST_RR_RUNS undefined, using default value = 10"
+#  define CONFIG_TESTING_OSTEST_RR_RUNS 4
+#  warning "CONFIG_TESTING_OSTEST_RR_RUNS undefined, using default value = 4"
 #elif (CONFIG_TESTING_OSTEST_RR_RUNS < 1) || (CONFIG_TESTING_OSTEST_RR_RUNS > 
32767)
-#  define CONFIG_TESTING_OSTEST_RR_RUNS 10
-#  warning "Invalid value of CONFIG_TESTING_OSTEST_RR_RUNS, using default 
value = 10"
+#  define CONFIG_TESTING_OSTEST_RR_RUNS 4
+#  warning "Invalid value of CONFIG_TESTING_OSTEST_RR_RUNS, using default 
value = 4"
 #endif
 
 /****************************************************************************

Reply via email to