|
34 | 34 | from collections.abc import Generator |
35 | 35 | from datetime import date, datetime, timezone |
36 | 36 | from pathlib import Path |
37 | | -from random import choice, randint |
| 37 | +from random import choice |
38 | 38 | from tempfile import TemporaryDirectory |
39 | 39 | from typing import ( |
40 | 40 | TYPE_CHECKING, |
@@ -815,19 +815,22 @@ def generate_snapshot( |
815 | 815 | snapshot_log = [] |
816 | 816 | initial_snapshot_id = 3051729675574597004 |
817 | 817 |
|
| 818 | + base_timestamp_ms = 1602638573590 |
818 | 819 | for i in range(2000): |
819 | 820 | snapshot_id = initial_snapshot_id + i |
820 | 821 | parent_snapshot_id = snapshot_id - 1 if i > 0 else None |
821 | | - timestamp_ms = int(time.time() * 1000) - randint(0, 1000000) |
| 822 | + timestamp_ms = base_timestamp_ms + i |
822 | 823 | snapshots.append(generate_snapshot(snapshot_id, parent_snapshot_id, timestamp_ms, i)) |
823 | 824 | snapshot_log.append({"snapshot-id": snapshot_id, "timestamp-ms": timestamp_ms}) |
824 | 825 |
|
| 826 | + last_updated_ms = snapshot_log[-1]["timestamp-ms"] |
| 827 | + |
825 | 828 | return { |
826 | 829 | "format-version": 2, |
827 | 830 | "table-uuid": "9c12d441-03fe-4693-9a96-a0705ddf69c1", |
828 | 831 | "location": "s3://bucket/test/location", |
829 | 832 | "last-sequence-number": 34, |
830 | | - "last-updated-ms": 1602638573590, |
| 833 | + "last-updated-ms": last_updated_ms, |
831 | 834 | "last-column-id": 3, |
832 | 835 | "current-schema-id": 1, |
833 | 836 | "schemas": [ |
|
0 commit comments