Skip to content

Commit 2619b9f

Browse files
Revert changes out of scope of docs
1 parent a3a1e06 commit 2619b9f

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

tests/benchmarks/conftest.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,13 @@ def tracemalloc_peak() -> TracemallocPeak:
5151
def write_jsonl(path: Path, line_count: int, *, first_timestamp: str | None = None) -> Path:
5252
"""Write a JSONL session file with *line_count* rows derived from the template fixture."""
5353
template = json.loads(TEMPLATE_LINE)
54-
if first_timestamp is not None:
55-
base_dt = datetime.fromisoformat(first_timestamp.replace("Z", "+00:00"))
56-
else:
57-
base_dt = _EXPORT_SESSION_BASE.replace(hour=10)
5854
with path.open("w", encoding="utf-8") as f:
5955
for i in range(line_count):
6056
entry = deepcopy(template)
61-
entry["timestamp"] = (base_dt + timedelta(minutes=i)).strftime("%Y-%m-%dT%H:%M:%SZ")
57+
if i == 0 and first_timestamp is not None:
58+
entry["timestamp"] = first_timestamp
59+
else:
60+
entry["timestamp"] = f"2026-06-12T10:{i % 60:02d}:00Z"
6261
if i % 3 == 1:
6362
msg = entry.setdefault("message", {})
6463
if isinstance(msg, dict) and "content" in msg:
@@ -80,11 +79,8 @@ def seed_search_corpus(
8079
"""Create a multi-session project tree under *base_dir* for search benchmarks."""
8180
project = base_dir / "bench-project"
8281
project.mkdir(parents=True, exist_ok=True)
83-
# Keep every message inside the default 30-day search window (see DEFAULT_SEARCH_WINDOW_DAYS).
84-
anchor = datetime.now(UTC) - timedelta(days=1)
8582
for i in range(session_count):
86-
first_ts = (anchor + timedelta(minutes=i * 30)).strftime("%Y-%m-%dT%H:%M:%SZ")
87-
write_jsonl(project / f"session_{i:04d}.jsonl", lines_per_session, first_timestamp=first_ts)
83+
write_jsonl(project / f"session_{i:04d}.jsonl", lines_per_session)
8884
return base_dir
8985

9086

0 commit comments

Comments
 (0)