Skip to content

Conversation

scotts
Copy link
Contributor

@scotts scotts commented Oct 15, 2025

Both test_video_encoder_round_trip() and test_video_encoder_against_ffmpeg_cli() are taking around 30 seconds or more on my dev machine for webm. If we could just say that the webm option is slow, that would be better, but I think this is okay for now.

This is relevant for when we just say pytest test, it will default to not running the slow tests. See our pyproject.toml:

[tool.pytest.ini_options]
markers = [
# defines a 'slow' mark to mark slow tests with `@pytest.mark.slow`
"slow: mark test as slow"
]
# We don't want to run the slow tests by default. These options are ignored in
# the CI, where we definitely want the 'slow' tests to run.
addopts = "-v -m 'not slow'"

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 15, 2025
@scotts scotts marked this pull request as ready for review October 15, 2025 19:46
Copy link
Contributor

@Dan-Flores Dan-Flores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

Copy link
Contributor

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but let's mark the webm tests only, as you originally suggested. I shared an example below on how to do that

test/test_ops.py Outdated
Comment on lines 1387 to 1388
@pytest.mark.slow
@pytest.mark.parametrize("format", ("mov", "mp4", "mkv", "webm"))
Copy link
Contributor

@NicolasHug NicolasHug Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can "mark" individual entries with arbitrary marks:

Suggested change
@pytest.mark.slow
@pytest.mark.parametrize("format", ("mov", "mp4", "mkv", "webm"))
@pytest.mark.parametrize(
"format", ("mov", "mp4", "mkv", pytest.param("webm", marks=pytest.mark.slow))
)

This is also how we handle our automatic "needs_cuda" mark:

torchcodec/test/utils.py

Lines 29 to 34 in b9cf8d1

def all_supported_devices():
return (
"cpu",
pytest.param("cuda", marks=pytest.mark.needs_cuda),
pytest.param("cuda:0:beta", marks=pytest.mark.needs_cuda),
)

test/test_ops.py Outdated
@pytest.mark.slow
@pytest.mark.skipif(in_fbcode(), reason="ffmpeg CLI not available")
@pytest.mark.parametrize(
"format", ("mov", "mp4", "avi", "mkv", "webm", "flv", "gif")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@scotts scotts merged commit cdb7eaf into meta-pytorch:main Oct 16, 2025
57 of 58 checks passed
@scotts scotts deleted the encoder_slow branch October 16, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants