diff --git a/tosfs/tests/test_stability.py b/tosfs/tests/test_stability.py index 443fc33..cb625a4 100644 --- a/tosfs/tests/test_stability.py +++ b/tosfs/tests/test_stability.py @@ -19,8 +19,8 @@ def test_write_breakpoint_continuation(tosfs, bucket, temporary_workspace): file_name = f"{random_str()}.txt" - first_part = random_str(10 * 1024 * 1024) - second_part = random_str(10 * 1024 * 1024) + first_part = random_str(9 * 1024 * 1024) + second_part = random_str(9 * 1024 * 1024) with tosfs.open(f"{bucket}/{temporary_workspace}/{file_name}", "w") as f: f.write(first_part) @@ -28,24 +28,24 @@ def test_write_breakpoint_continuation(tosfs, bucket, temporary_workspace): sleep(60) f.write(second_part) - with tosfs.open(file_name, "r") as f: + with tosfs.open(f"{bucket}/{temporary_workspace}/{file_name}", "r") as f: assert f.read() == first_part + second_part def test_read_breakpoint_continuation(tosfs, bucket, temporary_workspace): file_name = f"{random_str()}.txt" - first_part = random_str(10 * 1024 * 1024) - second_part = random_str(10 * 1024 * 1024) + first_part = random_str(9 * 1024 * 1024) + second_part = random_str(9 * 1024 * 1024) with tosfs.open(f"{bucket}/{temporary_workspace}/{file_name}", "w") as f: f.write(first_part) f.write(second_part) - with tosfs.open(file_name, "r") as f: - read_first_part = f.read(10 * 1024 * 1024) + with tosfs.open(f"{bucket}/{temporary_workspace}/{file_name}", "r") as f: + read_first_part = f.read(9 * 1024 * 1024) assert read_first_part == first_part # mock a very long block(business processing or network issue) sleep(60) - read_second_part = f.read(10 * 1024 * 1024) + read_second_part = f.read(9 * 1024 * 1024) assert read_second_part == second_part assert read_first_part + read_second_part == first_part + second_part