From 267f7e636b58149e1cdf600e02b9db9229d9765f Mon Sep 17 00:00:00 2001 From: "John M. Schanck" Date: Fri, 24 Jan 2025 16:00:58 -0800 Subject: [PATCH 1/2] moz_kinto_publisher: remove obsolete "big stash" test --- moz_kinto_publisher/test_publisher.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/moz_kinto_publisher/test_publisher.py b/moz_kinto_publisher/test_publisher.py index 4941c278..73b157e3 100644 --- a/moz_kinto_publisher/test_publisher.py +++ b/moz_kinto_publisher/test_publisher.py @@ -358,19 +358,6 @@ def test_publish_multiple_stashes(self): self.assertEqual(None, rw_client.publish()) self.assertEqual(db_run_ids, rw_client.get_run_ids()) - def test_publish_big_stash(self): - # A big stash should cause us to publish a new filter - rw_client = MockClient() - db = MockRunDB() - # publish a full filter - db_run_ids = [db.add_run(filter_size=10, stash_size=0)] - self.assertEqual(db_run_ids[0], rw_client.publish()) - self.assertEqual(db_run_ids, rw_client.get_run_ids()) - # add a run with a large stash, we should publish a full filter - db_run_ids += [db.add_run(filter_size=10, stash_size=1000)] - self.assertEqual(db_run_ids[-1], rw_client.publish()) - self.assertEqual([db_run_ids[-1]], rw_client.get_run_ids()) - def test_publish_delayed_run(self): rw_client = MockClient() db = MockRunDB() From 041fc6c2f10f480155894bc21966b61058139275 Mon Sep 17 00:00:00 2001 From: "John M. Schanck" Date: Fri, 24 Jan 2025 16:04:14 -0800 Subject: [PATCH 2/2] moz_kinto_publisher: remove delayed run checks --- moz_kinto_publisher/main.py | 15 --------------- moz_kinto_publisher/test_publisher.py | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/moz_kinto_publisher/main.py b/moz_kinto_publisher/main.py index 29d83b58..53a2c66b 100755 --- a/moz_kinto_publisher/main.py +++ b/moz_kinto_publisher/main.py @@ -901,14 +901,6 @@ def crlite_verify_record_consistency(*, existing_records, channel): if maxHeight != len(existing_records) - 1: raise ConsistencyException(f"Multiple filter descendents: {full_filters}") - # There should be no long gaps between record timestamps - allowed_delta = timedelta(hours=8) - timestamps = [timestamp_from_record(r) for r in existing_records] - for x, y in zip(timestamps, timestamps[1:]): - if y - x > allowed_delta: - raise ConsistencyException(f"Too-wide a delta: {y-x}") - - def crlite_verify_run_id_consistency(*, run_db, identifiers_to_check, channel): # The runs should be complete. for r in identifiers_to_check: @@ -927,13 +919,6 @@ def crlite_verify_run_id_consistency(*, run_db, identifiers_to_check, channel): if x > y: raise ConsistencyException(f"Out-of-order timestamp: {ts}") - # There should be no large gaps between run timestamps. - allowed_delta = timedelta(hours=8) - for x, y in zip(ts, ts[1:]): - if y - x > allowed_delta: - raise ConsistencyException(f"Too-wide a delta: {y-x}") - - def crlite_determine_publish(*, existing_records, run_db, channel): assert len(run_db) > 0, "There must be run identifiers" diff --git a/moz_kinto_publisher/test_publisher.py b/moz_kinto_publisher/test_publisher.py index 73b157e3..dba09304 100644 --- a/moz_kinto_publisher/test_publisher.py +++ b/moz_kinto_publisher/test_publisher.py @@ -358,21 +358,6 @@ def test_publish_multiple_stashes(self): self.assertEqual(None, rw_client.publish()) self.assertEqual(db_run_ids, rw_client.get_run_ids()) - def test_publish_delayed_run(self): - rw_client = MockClient() - db = MockRunDB() - db_run_ids = [db.add_run()] - self.assertEqual(db_run_ids[0], rw_client.publish()) - self.assertEqual(db_run_ids, rw_client.get_run_ids()) - # add a stash from a run that was delayed - db_run_ids += [db.add_run(delta=timedelta(hours=12))] - self.assertEqual(None, rw_client.publish()) - self.assertEqual(db_run_ids, rw_client.get_run_ids()) - # the next consistency check will fail, and a full filter will be published - db_run_ids += [db.add_run()] - self.assertEqual(db_run_ids[2], rw_client.publish()) - self.assertEqual([db_run_ids[2]], rw_client.get_run_ids()) - def test_publish_ten_day_old_filter(self): # a new filter should be published every 10 days rw_client = MockClient()