From d620e4c3ea42b0df6eb5e8dab92d7a8f031fa617 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Thu, 5 Nov 2026 13:59:14 +0100 Subject: Take the clock off the wall --- tests/integration/test_fullscrape.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/integration/test_fullscrape.py') diff --git a/tests/integration/test_fullscrape.py b/tests/integration/test_fullscrape.py index be7b502..3150612 100644 --- a/tests/integration/test_fullscrape.py +++ b/tests/integration/test_fullscrape.py @@ -78,13 +78,15 @@ class FullScrape(TrackerTestCase): escaped = line.rsplit(b":", 2)[0] self.assertIn(b"%", escaped, "these hashes are mostly unprintable bytes") - def test_the_state_dump_carries_a_base_time_rather_than_a_peer_count(self): - """What a restart reads back, so its second column is the torrent's - own clock and not a count of anybody.""" + def test_the_state_dump_carries_an_age_rather_than_a_peer_count(self): + """What a restart reads back. The second column is how many minutes + ago the torrent was last touched, not a stamp and not a count of + anybody: the clock counts from boot, so an absolute time would mean + nothing to the process that reads it.""" entries = self.entries_from_lines(self.scrape_all("/stats?mode=statedump")) self.assertIn(self.seeding.hex().upper().encode(), entries) - base, completed = entries[self.seeding.hex().upper().encode()] - self.assertGreater(int(base), 0) + age, completed = entries[self.seeding.hex().upper().encode()] + self.assertEqual(int(age), 0, "announced a moment ago") self.assertEqual(int(completed), 0) # ------------------------------------------------------------ shape -- cgit v1.3