[Concept,02/16] buildman: Fix flaky test_kconfig_change test properly

Message ID 20251227204318.886983-3-sjg@u-boot.org
State New
Headers
Series fs: ext4l: Complete read-only filesystem support (Part I) |

Commit Message

Simon Glass Dec. 27, 2025, 8:42 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The previous fix using -T4 is insufficient because queue-based job
distribution does not guarantee one board per thread. Even with 4
threads and 4 boards, a faster thread can finish its board and grab
another from the queue, causing .config to leak between boards in
the same thread's work directory.

Fix by using -P (per-board-out-dir) which gives each board its own
output directory, completely preventing .config leakage regardless
of thread scheduling.

Fixes: 17618b597508 ("buildman: Fix flaky test_kconfig_change test")
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 tools/buildman/func_test.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 31cff04a060..6167ea525e7 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -1285,13 +1285,13 @@  something: me
                 config_exists[0] = True
             return exists
 
-        # Run buildman with kconfig checking enabled. Use -T4 to ensure each
-        # board gets its own thread, avoiding .config leaking between boards
-        # when a thread processes multiple boards (which happens with <4 CPUs)
+        # Run buildman with kconfig checking enabled. Use -P to give each
+        # board its own output directory, preventing .config from leaking
+        # between boards when a thread processes multiple boards sequentially.
         with mock.patch.object(builderthread, 'kconfig_changed_since',
                                mock_kconfig_changed):
             self._RunControl('-b', TEST_BRANCH, '-c2', '-o', self._output_dir,
-                             '-T4')
+                             '-P')
 
         # Verify kconfig_changed_since was called
         self.assertGreater(call_count[0], 0)