Repository navigation
Live-cloud round-trip test: a downloaded series' members must be readable (SyncFiles=true and =false) #304
Description
Follow-up carved out of the closing note on #300. Second of the two follow-ups (the first was #302 -- the SyncFiles=false ingest_locations rebuild, on its way to landing as PR #303).
What is missing
NDI-python has no live-cloud test that a downloaded file series' members are actually readable end to end. Today's series coverage is:
tests/test_cloud_series_reconstruction.py::TestThroughARealDatabase-- offline; DID dispatch is real,fetch_cloud_fileis mocked. Good for pinning theingest_locationsreconstruction shape and the manifest's local read path.tests/test_cloud_series_reconstruction_remote.py(added in PR Rebuild series ingest_locations on SyncFiles=false download (#302) #303) -- offline; a mockcustomFileHandlerserves manifest bytes by uid. Good for pinning the SyncFiles=false reconstruction shape without cloud credentials.
Neither exercises the real cloud round trip. That gap is what let the retirement PRs (VH-Lab/NDI-matlab#989, #301) get all the way to "green" on the mocked path while breaking the actual read: without the second ndicloud location on a manifest, NDI's download_file_from_cloud refuses any sourcePath that does not start with ndic://, DID reads a handler that produces nothing as a plain miss, and every member of a downloaded series reads as absent -- silently. NDI-matlab caught the same regression on FileSeriesRoundTripTest.testMembersSurviveADownloadFromTheCloud and testMembersSurviveADownloadFromTheCloudWithSyncFilesFalse. NDI-python has no equivalent.
What to add
A Python analog of NDI-matlab's tests/+ndi/+unittest/+cloud/FileSeriesRoundTripTest.m, in whatever the current NDI-python cloud-test conventions call for. Two acceptance tests, both live-cloud:
-
SyncFiles=true -- upload a small series document (say 3-4 members with distinct byte contents), download it into a fresh folder with
sync_files=True, open each member end to end, verify bytes byte-for-byte (not by length; a uid mixup returns the right size and wrong file). MirrorstestMembersSurviveADownloadFromTheCloud. -
SyncFiles=false -- upload the same shape, download with
sync_files=False(manifest arrives asndic://only, no bytes on disk), open each member. This exercises DID#201 / DID-python#88's lazy manifest fetch plus the ingest_locations reconstruction Rebuild series ingest_locations on SyncFiles=false download (companion to VH-Lab/NDI-matlab#988) #302 / PR Rebuild series ingest_locations on SyncFiles=false download (#302) #303 landed. MirrorstestMembersSurviveADownloadFromTheCloudWithSyncFilesFalse. Precondition assertion: neither the manifest nor any member on this machine before the first open, so a pre-existing file cache cannot mask a real fetch.
Both tests should:
- assert every member came back openable and byte-for-byte correct, per-slot so a failure diagnostic names which members made the trip and which did not (
testMembersSurviveADownloadFromTheCloud's slot-by-slot loop is the model). - pin the batch-signed-URL path so the test does not silently fall back to per-uid
getFileDetailsand report success on a path it is not exercising (batchStats.uidMisses == 0, matching the MATLAB assertion). The Python equivalent lives inndi.cloud.batch_signed_url; a counter query pattern is what the MATLAB test uses -- seendi.cloud.download.internal.batchSignedUrlLookup'sclearCache/ counters mode.
Notes
- Cloud credentials required; slots naturally into whatever cloud-test lane the repo already runs (the CI has
Test Cloud APIon a schedule). - A member-uid nonce per run is important on this side too: DID's file cache is machine-global and keyed by uid, so a constant uid would let the fetch pass once and resolve from cache forever after -- silently regressing the very fetch the test exists to prove.
tests/test_cloud_series_reconstruction.py'stagfixture is the pattern. - Test data can be small (a few kilobytes total); the test is about the mechanism, not throughput.
References
- Retire the manifest cloud-reference workaround and add an offline SyncFiles=false round-trip test once DID-matlab#201 lands VH-Lab/NDI-matlab#986 (parent tracking issue)
- Offline test for a cloud-only series manifest (SyncFiles=false shape) (#986) VH-Lab/NDI-matlab#987, Cloud companion: SyncFiles=false round-trip in FileSeriesRoundTripTest (#986) VH-Lab/NDI-matlab#988 (the MATLAB port for the ingest_locations rebuild)
- Retire the manifest cloud-reference workaround (#986) VH-Lab/NDI-matlab#989 (the retracted retirement -- the class of regression this test would catch)
- localSeriesManifestPath cannot fetch a remote manifest — series reads fail on cloud-only downloads VH-Lab/DID-matlab#201, Fetch a remote-only series manifest through the custom_file_handler (#87) VH-Lab/DID-python#88 (the customFileHandler contract for a manifest fetch)
- Retire the manifest cloud-reference workaround (companion to VH-Lab/NDI-matlab#986) #300 (parent, closed; the closing comment flagged this gap)
- Rebuild series ingest_locations on SyncFiles=false download (companion to VH-Lab/NDI-matlab#988) #302 (the offline SyncFiles=false companion that lays the code path this test would validate)
Activity