From 0d9ba1c8efdb2d1af9a16fafafcefe7603b028fd Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Tue, 10 Nov 2026 23:48:22 +0000 Subject: [PATCH] test: Change the file size in the override retry test so the poller sees the malformed write The initial and malformed contents had the same size. Where file times are coarse, as on Windows, both writes can share a modification time, so the poller saw no change, nothing was logged, and the test timed out. The initial content now has a different size. --- ldclient/testing/integrations/test_file_override_source.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ldclient/testing/integrations/test_file_override_source.py b/ldclient/testing/integrations/test_file_override_source.py index 4ae4f4f8..b937b115 100644 --- a/ldclient/testing/integrations/test_file_override_source.py +++ b/ldclient/testing/integrations/test_file_override_source.py @@ -526,8 +526,11 @@ def test_source_retains_last_good_data_across_malformed_edit(tmp_path, sources, def test_source_retries_a_failed_load_without_a_change_signal(tmp_path, sources, caplog): # The fixed content has the same size as the malformed content and the file keeps its # modification time, so the poller sees no change. Only the automatic retry can recover. + # The initial content has a different size from the malformed content, so the poller sees + # the malformed write even where file times are coarse, as on Windows, and the two writes + # can share a modification time. path = os.path.join(str(tmp_path), 'overrides.json') - write_file(path, '{"flagValues": {"flag1": true}}') + write_file(path, '{"flagValues": {"flag1": true, "flag2": true}}') with caplog.at_level(logging.ERROR): _, sink = build_source(sources, [path], lambda b: b.poll_interval(FileOverrideSourceBuilder.MINIMUM_POLL_INTERVAL)) sink.require_snapshot()