This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nuttx-ntfc.git
The following commit(s) were added to refs/heads/main by this push:
new 441ba75 tests: fix race in GdbController coredump ledger test
441ba75 is described below
commit 441ba75cb32342306380b17b0b35147d97a1ac85
Author: raiden00pl <[email protected]>
AuthorDate: Wed Nov 25 08:54:40 2026 +0100
tests: fix race in GdbController coredump ledger test
Signed-off-by: raiden00pl <[email protected]>
---
tests/debug/test_gdb_controller.py | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/tests/debug/test_gdb_controller.py
b/tests/debug/test_gdb_controller.py
index 0218fda..941ff51 100644
--- a/tests/debug/test_gdb_controller.py
+++ b/tests/debug/test_gdb_controller.py
@@ -767,12 +767,20 @@ class TestGdbControllerCorefileLedger:
ctrl = GdbController(elf, _cfg())
w_file.write(b"(gdb) \n")
ctrl.start(timeout=5.0)
- w_file.write(f"Saved corefile {corefile}\n".encode())
- w_file.write(f"{GdbController.GCORE_MARKER}\n".encode())
- result = ctrl.generate_coredump(tmp_path, "pull", timeout=5.0)
+ _respond_on_gcore(
+ proc,
+ w_file,
+ (
+ f"Saved corefile {corefile}\n"
+ f"{GdbController.GCORE_MARKER}\n"
+ ).encode(),
+ )
+ try:
+ result = ctrl.generate_coredump(tmp_path, "pull", timeout=5.0)
+ later = ctrl.wait_corefile(timeout=0.05)
+ finally:
+ w_file.close()
+ ctrl.stop()
+ proc.stdout.close()
assert result == corefile
- later = ctrl.wait_corefile(timeout=0.05)
- w_file.close()
- ctrl.stop()
- proc.stdout.close()
assert later is None