[PATCH 2/4] test: bthread: change comparison condition for switches vs. yields
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Mar 27 07:47:40 PDT 2025
The code was written with the assumption that isolated yields from test
thread to main thread and back will always be at least as fast as
unrestricted scheduling.
This assumption held so far, but breaks down in sandbox, because it's
highly influenced by the system's CPU pressure.
Just check that we can schedule @1000Hz at least in both cases.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
test/py/test_bthread.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/py/test_bthread.py b/test/py/test_bthread.py
index 6e7b4ba5007e..84fb9f830b0c 100644
--- a/test/py/test_bthread.py
+++ b/test/py/test_bthread.py
@@ -20,4 +20,5 @@ def test_bthread(barebox, barebox_config):
switches = int(barebox.run_check("bthread -c")[0].split()[0])
yields = int(barebox.run_check("bthread -t")[0].split()[0])
- assert yields < switches
+ assert yields > 1000
+ assert yields > 1000
--
2.39.5
More information about the barebox
mailing list