Skip to content

Commit 015c0d1

Browse files
committed
fix(bench): ensure swap calibration uses odd repeat so commit check is not vacuous
When calibrate() returned an even repeat count for swap, the commit check in timeClick accepted the original row order—which is also what a no-op swap leaves—making the assertion meaningless. Force swap to an odd repeat so the check always verifies the row moved to index 998.
1 parent 0058938 commit 015c0d1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎benchmarks/js-framework/pair.mjs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ async function calibrate(page, op) {
175175
// A selection sample ends on the alternate row, so the next one starts by
176176
// selecting a different row instead of re-selecting the current one.
177177
if (op.alternateClick && repeat % 2 === 1) repeat++;
178+
// Swap must use an odd repeat so the commit check in timeClick can verify
179+
// the row actually moved (an even count restores the original order).
180+
if (op.name === 'swap' && repeat % 2 === 0) repeat++;
178181
return Math.max(repeat, 2);
179182
}
180183

0 commit comments

Comments
 (0)