meta-pytorch / meta-pytorch/torchcodec
Encoder tests sometimes fail on reading input
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 125
- Avg merge
- 22h 47m
- Merged PRs (30d)
- 54
Description
I've noticed that some of the encoder tests sometimes fail on reading input:
FAILED test/test_encoders.py::TestAudioEncoder::test_num_channels[to_file-2-2] - RuntimeError: Could not open input file: /tmp/pytest-of-root/pytest-0/test_num_channels_to_file_2_2_0/output.mp3 Invalid data found when processing input
FAILED test/test_encoders.py::TestAudioEncoder::test_num_channels[to_file-None-2] - RuntimeError: Could not open input file: /tmp/pytest-of-root/pytest-0/test_num_channels_to_file_None1/output.mp3 Invalid data found when processing input
FAILED test/test_encoders.py::TestAudioEncoder::test_num_channels[to_tensor-2-2] - RuntimeError: Failed to open input buffer: Invalid data found when processing input
FAILED test/test_encoders.py::TestAudioEncoder::test_num_channels[to_tensor-None-2] - RuntimeError: Failed to open input buffer: Invalid data found when processing input
When this happens locally, these tests usually pass after re-running. I also just saw an instance in CI: https://github.com/pytorch/torchcodec/actions/runs/15593694391/job/43919750761#step:15:730
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in test/test_encoders.py with TestAudioEncoder::test_num_channels and reproduce the intermittent failures locally. Inspect how the to_file and to_tensor cases produce and read output.mp3, then use the linked CI failure for comparison. Done means the affected encoder tests no longer intermittently fail when rerun locally or in CI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- audio-video-rtc, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100