Bug: feedback needed for uploading and downloading items
Issue: When downloading an item that was recently uploaded, Pod can return an error 500 Failure: Failed to read data from target file, No such file or directory (os error 2)
Example, fails on get_file: @pytest.fixture(scope="module") def client(): return PodClient()
@pytest.fixture def photo(): x = np.random.randint(0, 255+1, size=(640, 640), dtype=np.uint8) return Photo.from_np(x)
def test_create_file(client: PodClient, photo: Photo): client.add_to_schema(File, Photo) file = photo.file0 assert client.create(file) assert client.upload_file(photo.data)
data = client.get_file(file.sha256) assert photo.data == data
Fixed with a sleep(1) after upload, following test does succeed: def test_create_file(client: PodClient, photo: Photo): client.add_to_schema(File, Photo) file = photo.file0 assert client.create(file) assert client.upload_file(photo.data) sleep(1)
data = client.get_file(file.sha256) assert photo.data == data