diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-05 13:59:14 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-05 13:59:14 +0100 |
| commit | d620e4c3ea42b0df6eb5e8dab92d7a8f031fa617 (patch) | |
| tree | 86ce2474b0a15689b3feedeabc23c859363cae73 /tests/integration/test_fullscrape.py | |
| parent | e9fff370e84134a0e8c43e247be6b0d52e3fe697 (diff) | |
Take the clock off the wall
Diffstat (limited to 'tests/integration/test_fullscrape.py')
| -rw-r--r-- | tests/integration/test_fullscrape.py | 12 |
1 files changed, 7 insertions, 5 deletions
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): | |||
| 78 | escaped = line.rsplit(b":", 2)[0] | 78 | escaped = line.rsplit(b":", 2)[0] |
| 79 | self.assertIn(b"%", escaped, "these hashes are mostly unprintable bytes") | 79 | self.assertIn(b"%", escaped, "these hashes are mostly unprintable bytes") |
| 80 | 80 | ||
| 81 | def test_the_state_dump_carries_a_base_time_rather_than_a_peer_count(self): | 81 | def test_the_state_dump_carries_an_age_rather_than_a_peer_count(self): |
| 82 | """What a restart reads back, so its second column is the torrent's | 82 | """What a restart reads back. The second column is how many minutes |
| 83 | own clock and not a count of anybody.""" | 83 | ago the torrent was last touched, not a stamp and not a count of |
| 84 | anybody: the clock counts from boot, so an absolute time would mean | ||
| 85 | nothing to the process that reads it.""" | ||
| 84 | entries = self.entries_from_lines(self.scrape_all("/stats?mode=statedump")) | 86 | entries = self.entries_from_lines(self.scrape_all("/stats?mode=statedump")) |
| 85 | self.assertIn(self.seeding.hex().upper().encode(), entries) | 87 | self.assertIn(self.seeding.hex().upper().encode(), entries) |
| 86 | base, completed = entries[self.seeding.hex().upper().encode()] | 88 | age, completed = entries[self.seeding.hex().upper().encode()] |
| 87 | self.assertGreater(int(base), 0) | 89 | self.assertEqual(int(age), 0, "announced a moment ago") |
| 88 | self.assertEqual(int(completed), 0) | 90 | self.assertEqual(int(completed), 0) |
| 89 | 91 | ||
| 90 | # ------------------------------------------------------------ shape | 92 | # ------------------------------------------------------------ shape |
