Skip to content

Commit 166324a

Browse files
yarikopticclaude
andcommitted
bf(test): add timeout to test_nwb2asset_remote_asset to prevent CI hang
When dandi-cli tests are run from dandi-archive CI via `pytest --pyargs dandi`, the rootdir is dandi-archive, so dandi-cli's tox.ini [pytest] config (which has --timeout=300) is NOT read. This means the test has no timeout protection. With dandischema 0.12.0, the test no longer fails quickly (the model validation path changed), so it now reaches the fsspec HTTP read which can hang indefinitely. The xfail marker alone doesn't help -- xfail only catches exceptions, not hangs. Adding @pytest.mark.timeout(120) ensures the test is killed after 2 minutes regardless of which project runs it. The xfail marker then catches the timeout as an expected failure. Fixes: #1762 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a3dd9f9 commit 166324a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dandi/tests/test_metadata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,7 @@ def test_nwb2asset(simple2_nwb: Path) -> None:
11451145
)
11461146

11471147

1148+
@pytest.mark.timeout(120)
11481149
@pytest.mark.xfail(reason="https://github.com/dandi/dandi-cli/issues/1450")
11491150
def test_nwb2asset_remote_asset(nwb_dandiset: SampleDandiset) -> None:
11501151
pytest.importorskip("fsspec")

0 commit comments

Comments
 (0)