fix(failed_tests_file): correctly iterate testsFailed dict#251
Merged
kei-nan merged 2 commits intoMay 29, 2026
Conversation
`self.testsFailed` is a dict of `{test_name: [failures]}` (built via
`setdefault(name, []).extend(...)`). The `--failed-tests-file` writer
was iterating it as `for test, _ in self.testsFailed:`, which yields
dict keys (strings) and tries to unpack each key into two elements —
crashing with `ValueError: too many values to unpack (expected 2)` on
any test name longer than two characters.
This silently broke the failed-tests-file feature whenever a real run
had failures: the writer aborted before producing the file, so any
downstream tooling that depends on it saw no output.
Fix by iterating keys directly, since the value side wasn't used.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #251 +/- ##
==========================================
+ Coverage 32.46% 34.83% +2.37%
==========================================
Files 17 18 +1
Lines 2597 2733 +136
==========================================
+ Hits 843 952 +109
- Misses 1754 1781 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JoanFM
previously requested changes
May 28, 2026
Per @JoanFM, iterating the dict directly works but is implicit. Using .keys() makes it obvious to the reader that only the keys are needed.
GuyAv46
approved these changes
May 29, 2026
Addressed comment - got approval from Guy
Would like to merge this as soon as possible.
kei-nan
added a commit
to RediSearch/RediSearch
that referenced
this pull request
May 29, 2026
RLTest 0.7.27 includes the fix for the FAILEDFILE writer crashing on runs with actual failures (RedisLabsModules/RLTest#251). Without this, the flaky-DB record step sees no .failed_*.txt and reports 'No results to record' on any failing CI run. Switched the exact pin to a >=0.7.27,<0.8.0 range so future RLTest patch fixes are picked up via 'uv lock --upgrade-package rltest' without another pyproject.toml change.
kei-nan
added a commit
to RediSearch/RediSearch
that referenced
this pull request
May 29, 2026
RLTest 0.7.27 includes the fix for the FAILEDFILE writer crashing on runs with actual failures (RedisLabsModules/RLTest#251). Without this, the flaky-DB record step sees no .failed_*.txt and reports 'No results to record' on any failing CI run. Also bumps the lower bound from 0.7.18 to 0.7.27 so the explicit fix requirement is captured in pyproject.toml, not just uv.lock. psutil 5.9.8 -> 7.2.2 is a transitive dep bump that came with the RLTest 0.7.27 resolve.
kei-nan
added a commit
to RediSearch/RediSearch
that referenced
this pull request
May 29, 2026
RLTest 0.7.27 includes the fix for the FAILEDFILE writer crashing on runs with actual failures (RedisLabsModules/RLTest#251). Without this, the flaky-DB record step sees no .failed_*.txt and reports 'No results to record' on any failing CI run. Also bumps the lower bound from 0.7.18 to 0.7.27 so the explicit fix requirement is captured in pyproject.toml, not just uv.lock.
kei-nan
added a commit
to RediSearch/RediSearch
that referenced
this pull request
May 29, 2026
RLTest 0.7.27 includes the fix for the FAILEDFILE writer crashing on runs with actual failures (RedisLabsModules/RLTest#251). Without this, the flaky-DB record step sees no .failed_*.txt and reports 'No results to record' on any failing CI run. Also bumps the lower bound from 0.7.18 to 0.7.27 so the explicit fix requirement is captured in pyproject.toml, not just uv.lock.
kei-nan
added a commit
to RediSearch/RediSearch
that referenced
this pull request
May 29, 2026
RLTest 0.7.27 includes the fix for the FAILEDFILE writer crashing on runs with actual failures (RedisLabsModules/RLTest#251). Without this, the flaky-DB record step sees no .failed_*.txt and reports 'No results to record' on any failing CI run. Replaces the previous 'RLTest<=0.7.16' upper-bound pin with a >=0.7.27,<0.8.0 range so future RLTest patch fixes are picked up via 'uv lock --upgrade-package rltest' without another pyproject.toml change.
kei-nan
added a commit
to RediSearch/RediSearch
that referenced
this pull request
May 29, 2026
RLTest 0.7.27 includes the fix for the FAILEDFILE writer crashing on runs with actual failures (RedisLabsModules/RLTest#251). Without this, the flaky-DB record step sees no .failed_*.txt and reports 'No results to record' on any failing CI run. Also bumps the lower bound from 0.7.18 to 0.7.27 so the explicit fix requirement is captured in pyproject.toml, not just uv.lock.
kei-nan
added a commit
to RediSearch/RediSearch
that referenced
this pull request
May 29, 2026
RLTest 0.7.27 includes the fix for the FAILEDFILE writer crashing on runs with actual failures (RedisLabsModules/RLTest#251). Without this, the flaky-DB record step sees no .failed_*.txt and reports 'No results to record' on any failing CI run. Also bumps the lower bound from 0.7.18 to 0.7.27 so the explicit fix requirement is captured in pyproject.toml, not just uv.lock.
4 tasks
github-merge-queue Bot
pushed a commit
to RediSearch/RediSearch
that referenced
this pull request
May 31, 2026
RLTest 0.7.27 includes the fix for the FAILEDFILE writer crashing on runs with actual failures (RedisLabsModules/RLTest#251). Without this, the flaky-DB record step added in #9869 sees no .failed_*.txt and reports 'No results to record' on any failing CI run. The bug has been dormant on master because recent CI runs have been green; this lands the fix before the next failure hits the writer. Switched the exact pin to a >=0.7.27,<0.8.0 range so future RLTest patch fixes are picked up via 'uv lock --upgrade-package rltest' without another pyproject.toml change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
self.testsFailedis a dict of{test_name: [failures]}(built viasetdefault(name, []).extend(...)inaddFailureToTest). The--failed-tests-filewriter inRLTest/__main__.pyiterates it as:Iterating a dict yields keys (strings). Python then tries to unpack each key into
(test, _)— which fails for any test name longer than two characters:This silently breaks the
--failed-tests-file(-F) feature whenever a run actually has failures: the writer aborts before producing the file, RLTest exits with the unhandled exception, and any downstream tooling that depends on the file sees no output.Repro
Crashes with the traceback above;
/tmp/failed.txtis empty or missing.Fix
Iterate keys directly. The value side wasn't used (just
_), so this is the smallest correct change:Why this hasn't been caught
The buggy code only runs when
self.testsFailedis non-empty AND--failed-tests-fileis set. Most CI pipelines that use-Fonly see green runs, so the path stays dormant. Surfaced from the RediSearch flaky-test DB work (RediSearch/RediSearch#9869) when failures finally hit the writer.Test plan
--failed-tests-file=/tmp/f.txt→ confirm/tmp/f.txtlists the failed test names instead of crashingelsebranch)