Skip to content

Commit

Permalink
moz_kinto_publisher: remove delayed run checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jschanck committed Jan 27, 2025
1 parent 267f7e6 commit 041fc6c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
15 changes: 0 additions & 15 deletions moz_kinto_publisher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"

Expand Down
15 changes: 0 additions & 15 deletions moz_kinto_publisher/test_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 041fc6c

Please sign in to comment.