Skip to content

Increase TS E2E test data size to fix flaky js-ts-class#2051

Merged
KRRT7 merged 4 commits into
mainfrom
fix/ts-e2e-test-data-size
Apr 10, 2026
Merged

Increase TS E2E test data size to fix flaky js-ts-class#2051
KRRT7 merged 4 commits into
mainfrom
fix/ts-e2e-test-data-size

Conversation

@KRRT7
Copy link
Copy Markdown
Contributor

@KRRT7 KRRT7 commented Apr 10, 2026

Summary

  • Bump findDuplicates benchmark test data from n=100 to n=10,000

Problem

The js-ts-class E2E test is flaky because at n=100, the O(n²)→O(n) optimization the LLM correctly generates (Map-based deduplication) benchmarks as slower (-10.6%) due to Map/Set per-operation overhead dominating at small input sizes.

Fix

At n=10,000, the algorithmic improvement reliably produces measurable speedup, making the 30% E2E threshold consistently achievable.

Test plan

  • Local npx jest passes (83/83)
  • CI js-ts-class E2E passes with the new data size

@KRRT7 KRRT7 marked this pull request as ready for review April 10, 2026 00:21
@github-actions github-actions Bot added the workflow-modified This PR modifies GitHub Actions workflows label Apr 10, 2026
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 temporarily deployed to external-trusted-contributors April 10, 2026 00:43 — with GitHub Actions Inactive
@KRRT7 KRRT7 force-pushed the fix/ts-e2e-test-data-size branch 2 times, most recently from 722b3d8 to 744a9d6 Compare April 10, 2026 03:22
KRRT7 and others added 4 commits April 9, 2026 22:26
The js-ts-class E2E test was flaky because n=100 is too small for
the O(n²)→O(n) optimization to overcome Map/Set per-operation overhead.
At n=100, the LLM correctly generates a Map-based O(n) solution but it
benchmarks as slower (-10.6%) due to constant factor dominance.

Bump to n=10,000 so the algorithmic improvement produces measurable
speedup, making the 30% E2E threshold reliably achievable.
The change detection for JS E2E tests was missing the test fixture
directory, so PRs that only modify JS test data (like this one) were
skipped. Java already had its equivalent path included.
The profiler's save() was called every 100 hit() calls. With O(n²)
algorithms this produced hundreds of thousands of writeFileSync calls,
each truncating the file to 0 bytes before writing. If the subprocess
timed out (SIGKILL), the file was left at 0 bytes → JSONDecodeError.

Fixes:
- Move require('fs')/require('path') to module scope (not inside save())
- Reduce save-every-N from 100 → 10,000 hits (100x fewer syscalls)
- Pre-create output file with {} before running Jest (safety net)
- Handle empty files gracefully in parse_results
- Fix misleading "file not found" warning → "file empty or no timing data"
@KRRT7 KRRT7 force-pushed the fix/ts-e2e-test-data-size branch from c4c59dc to 8ca0f8d Compare April 10, 2026 03:26
@KRRT7 KRRT7 merged commit 7351d0f into main Apr 10, 2026
4 of 5 checks passed
@KRRT7 KRRT7 deleted the fix/ts-e2e-test-data-size branch April 10, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workflow-modified This PR modifies GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant