Skip to content

Commit 435bc9c

Browse files
la14-1spawn-qa-botclaude
authored
test: remove duplicate boundary tests in history-trimming (#2242)
Remove two tests from "sequential saves at the boundary" that were exact duplicates of tests in the "MAX_HISTORY_ENTRIES trimming" section: - "99 to 100 entries" duplicated "should keep all entries when at exactly 100" - "100 to 101 entries" duplicated "should trim to 100 when adding entry that exceeds the limit" Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ee9ae46 commit 435bc9c

1 file changed

Lines changed: 3 additions & 46 deletions

File tree

packages/cli/src/__tests__/history-trimming.test.ts

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -885,52 +885,9 @@ describe("History Trimming and Boundaries", () => {
885885
// ── Race-like sequential saves near the boundary ────────────────────────
886886

887887
describe("sequential saves at the boundary", () => {
888-
it("should correctly handle saving from exactly 99 to 100 entries", () => {
889-
const records: SpawnRecord[] = [];
890-
for (let i = 0; i < 99; i++) {
891-
records.push({
892-
agent: `agent-${i}`,
893-
cloud: "cloud",
894-
timestamp: "2026-01-01T00:00:00.000Z",
895-
});
896-
}
897-
writeFileSync(join(testDir, "history.json"), JSON.stringify(records));
898-
899-
saveSpawnRecord({
900-
agent: "agent-99",
901-
cloud: "cloud",
902-
timestamp: "2026-01-01T00:00:00.000Z",
903-
});
904-
905-
const loaded = loadHistory();
906-
expect(loaded).toHaveLength(100);
907-
// No trimming should have happened
908-
expect(loaded[0].agent).toBe("agent-0");
909-
});
910-
911-
it("should correctly handle saving from exactly 100 to 101 entries (trim boundary)", () => {
912-
const records: SpawnRecord[] = [];
913-
for (let i = 0; i < 100; i++) {
914-
records.push({
915-
agent: `agent-${i}`,
916-
cloud: "cloud",
917-
timestamp: "2026-01-01T00:00:00.000Z",
918-
});
919-
}
920-
writeFileSync(join(testDir, "history.json"), JSON.stringify(records));
921-
922-
saveSpawnRecord({
923-
agent: "agent-100",
924-
cloud: "cloud",
925-
timestamp: "2026-01-01T00:00:00.000Z",
926-
});
927-
928-
const loaded = loadHistory();
929-
expect(loaded).toHaveLength(100);
930-
// Oldest entry should be trimmed
931-
expect(loaded[0].agent).toBe("agent-1");
932-
expect(loaded[99].agent).toBe("agent-100");
933-
});
888+
// NOTE: "99 to 100" and "100 to 101" boundary tests were removed as duplicates
889+
// of "should keep all entries when at exactly 100" and "should trim to 100 when
890+
// adding entry that exceeds the limit" in the MAX_HISTORY_ENTRIES section above.
934891

935892
it("should handle rapid sequential saves that build up from zero", () => {
936893
for (let i = 0; i < 105; i++) {

0 commit comments

Comments
 (0)