split: make flaky test more verbose #6015
Closed
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.
test_round_robin_limited_file_descriptors
is flaky and causes real problems.The test imposes
.limit(Resource::NOFILE, 9, 9)
, that's the point of the test. On my machine, this number can be lowered to 5; it always works with 5 or above, and never works below that. So I would assume that the "real" limit is 5 (plus minus a bit wiggle room for version differences).On CI, it usually works with 9, but sometimes fails in the middle of the run (
xaz
, the 26th file), so it seems like there is a real issue, like an fd leak. (So we should not just raise the number.)So let's at least make this test more verbose. This way, the next time it fails, we can see where exactly in
<OutFiles as ManageOutFiles>::get_writer
it fails. (At least that's where I think it fails.)I have a bit of a bad feeling that it might be the line
out_file.maybe_writer.as_mut().unwrap().flush()?;
, i.e. flushing old files while there are no free descriptors left.I would also love to run
lsof
at the time of crash, but since I cannot reproduce this issue locally, there's no way for me to do so. (And trying to do it automatically seems extremely difficult.)