Skip to content

Commit b654911

Browse files
authored
fix(web): stop session activity timing test from blocking releases (pingdotgg#8585)
1 parent 0bbecfa commit b654911

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎apps/web/src/session-logic.test.ts‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,7 @@ describe("session activity performance", () => {
22812281
expect(appendedEntries[1]).toBe(initialEntries[1]);
22822282
});
22832283

2284-
it("updates 20,000 ordered tool activities within 100 ms", () => {
2284+
it("reuses entries when appending to 20,000 ordered tool activities", () => {
22852285
const activities = Array.from({ length: 20_000 }, (_, index) =>
22862286
makeActivity({
22872287
id: `benchmark-tool-${index}`,
@@ -2299,7 +2299,8 @@ describe("session activity performance", () => {
22992299
},
23002300
}),
23012301
);
2302-
deriveWorkLogEntries(activities);
2302+
const initialEntries = deriveWorkLogEntries(activities);
2303+
expect(initialEntries).toHaveLength(20_000);
23032304
const updatedActivities = [
23042305
...activities,
23052306
makeActivity({
@@ -2316,8 +2317,13 @@ describe("session activity performance", () => {
23162317
}),
23172318
];
23182319

2319-
const startedAt = performance.now();
2320-
expect(deriveWorkLogEntries(updatedActivities)).toHaveLength(20_001);
2321-
expect(performance.now() - startedAt).toBeLessThan(100);
2320+
const updatedEntries = deriveWorkLogEntries(updatedActivities);
2321+
expect(updatedEntries).toHaveLength(20_001);
2322+
expect(initialEntries.every((entry, index) => updatedEntries[index] === entry)).toBe(true);
2323+
expect(updatedEntries.at(-1)).toMatchObject({
2324+
id: "benchmark-tool-appended",
2325+
command: "git diff",
2326+
toolLifecycleStatus: "completed",
2327+
});
23222328
});
23232329
});

0 commit comments

Comments
 (0)