tests: Start thread only after registering cleanups and registering thread

Not that this matters.
This commit is contained in:
Erik Johnston committed 2026-11-05 16:47:34 +00:00
1 parent e8af64eafc
commit 0a238e009b
1 file changed
+2 -1
+2 -1
View File
@@ -90,7 +90,6 @@ class ThreadCPUMetricsTestCase(unittest.TestCase):
# Note that the thread name only gets passed to the kernel from Python
# 3.14 onwards.
thread = threading.Thread(target=run_on_thread, name="a) b) (c")
thread.start()
# Cleanup functions are run in reverse order, so first we set the
# release event (to wake the thread up), and then we wait for it exit.
@@ -99,6 +98,8 @@ class ThreadCPUMetricsTestCase(unittest.TestCase):
metrics.register_thread("test-thread", thread)
thread.start()
# Wait for the separate thread to burn CPU before continuing.
self.assertTrue(burnt.wait(timeout=Duration(seconds=10).as_secs()))