Fix cxl-translate.sh test failures
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | test/cxl-translate.sh: Wait expected log before checking resulttest/ | +21 | 1 reply | |
| 2/2 | test/cxl-translate.sh: Wait for test completion before checking resulttest/ | +1 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [ndctl PATCH 0/2] Fix cxl-translate.sh test failures
When running cxl-translate.sh repeatedly in my test environment, I can occasionally reproduce test failures. The failure point varies from run to run, but the root cause is the same: the test is unable to find the expected kernel log messages.
Investigation shows that the expected messages are actually present in dmesg. However, immediately after "modprobe cxl_translate" completes, "journalctl --reverse --dmesg" may not yet have received all kernel messages emitted during cxl_translate_init(). This timing gap causes the test script to miss expected log entries and report false failures.
This patchset addresses the issue in two steps:
Patch 1 adds a helper that retries fetching the expected kernel log message for up to 5 seconds. This mitigates failures caused by temporary delays in log visibility through journalctl.
Patch 2 updates the result checking logic for test cases that use a specific translation table. Instead of treating the appearance of a "CXL Translate Test.*PASS|FAIL" message as an indication that the test has finished, it waits for the "CXL translate test completed" message. During test execution, multiple "CXL Translate Test.*PASS|FAIL" messages may be emitted as individual checks complete, so the presence of such messages does not necessarily mean that the entire test has finished. The completion message provides a reliable indication that all test cases have completed and all results are available for verification.
Li Ming (2):
test/cxl-translate.sh: Wait expected log before checking result test/cxl-translate.sh: Wait for test completion before checking result
test/cxl-translate.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
Signature · 1 line
2.43.0