From c9614ec1b90ba108e2744c6103d32a20fccc5af1 Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin Date: Thu, 8 Apr 2021 14:04:53 -0400 Subject: [PATCH 1/2] TST: flaky zip test --- pandas/tests/io/test_gcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/test_gcs.py b/pandas/tests/io/test_gcs.py index 356c82293359a..5035f75798154 100644 --- a/pandas/tests/io/test_gcs.py +++ b/pandas/tests/io/test_gcs.py @@ -99,12 +99,12 @@ def test_to_read_gcs(gcs_buffer, format): def assert_equal_zip_safe(result: bytes, expected: bytes): """ - We would like to assert these are equal, but the 11th byte is a last-modified + We would like to assert these are equal, but the 10th and 11th bytes are a last-modified timestamp, which in some builds is off-by-one, so we check around that. See https://en.wikipedia.org/wiki/ZIP_(file_format)#File_headers """ - assert result[:10] == expected[:10] + assert result[:9] == expected[:9] assert result[11:] == expected[11:] From af0e3fc18e8be839c9dfc6ecb79b709a244aabe0 Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin Date: Thu, 8 Apr 2021 14:05:27 -0400 Subject: [PATCH 2/2] precommit fixup --- pandas/tests/io/test_gcs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/test_gcs.py b/pandas/tests/io/test_gcs.py index 5035f75798154..2ba4fbe71e244 100644 --- a/pandas/tests/io/test_gcs.py +++ b/pandas/tests/io/test_gcs.py @@ -99,8 +99,9 @@ def test_to_read_gcs(gcs_buffer, format): def assert_equal_zip_safe(result: bytes, expected: bytes): """ - We would like to assert these are equal, but the 10th and 11th bytes are a last-modified - timestamp, which in some builds is off-by-one, so we check around that. + We would like to assert these are equal, but the 10th and 11th bytes are a + last-modified timestamp, which in some builds is off-by-one, so we check around + that. See https://en.wikipedia.org/wiki/ZIP_(file_format)#File_headers """