Skip to content

fix(test): seed random in IntervalOpExecSpec - #8443

Closed
VuMartin wants to merge 2 commits into
apache:mainfrom
VuMartin:fix/8150-seed-interval-random
Closed

VuMartin wants to merge 2 commits into
apache:mainfrom
VuMartin:fix/8150-seed-interval-random

Conversation

@VuMartin

@VuMartin VuMartin commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Replace the unseeded global scala.util.Random usage in IntervalOpExecSpec with a local seeded random generator (Random(42)). This makes the test inputs deterministic and ensures test execution paths and JaCoCo branch coverage are reproducible across runs.

Before:
First Run:
Screenshot 2026-09-06 at 3 09 28 AM

Second Run:
Screenshot 2026-09-06 at 3 10 29 AM

After:
First Run:
Screenshot 2026-09-06 at 3 14 59 AM

Second Run:
Screenshot 2026-09-06 at 3 15 07 AM

Any related issues, documentation, discussions?

Closes #8150

How was this PR tested?

  • Ran IntervalOpExecSpec successfully.
  • Reproduced the issue before the fix: IntervalJoinOpExec.scala branch coverage changed between runs (20 missed / 78 covered vs. 21 missed / 77 covered).
  • Verified the test now uses a seeded local random generator for all random inputs.
  • Ran the JaCoCo coverage report multiple times and verified the branch coverage is consistent across runs.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: ChatGPT (5.5 mini)

@Yicong-Huang Yicong-Huang added release/v1.3 back porting to release/v1.3 release/v1.2 back porting to release/v1.2 labels Sep 7, 2026
@github-actions
github-actions Bot requested review from mengw15 and xuang7 September 7, 2026 00:01
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. A release/* label nominates a backport target; the branch's release manager approving this PR is what sends the fix there. The required Backport Approvals check stays red until every label below is approved, so each manager either approves or removes their own label — which is why the labels left on a merged PR are exactly the branches it reached.

Release branch Analysis
✅ release/v1.3 Change detected on this branch — label added; this fix is queued to backport here. @mengw15 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.
✅ release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. @xuang7 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.

Auto-label run.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @mengw15
    You can notify them by mentioning @mengw15 in a comment.

@codecov-commenter

codecov-commenter commented Sep 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.03%. Comparing base (27f21a9) to head (1f4ced3).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8443   +/-   ##
=========================================
  Coverage     94.03%   94.03%           
  Complexity     4820     4820           
=========================================
  Files          1208     1208           
  Lines         49219    49219           
  Branches       5982     5982           
=========================================
  Hits          46284    46284           
  Misses         1464     1464           
  Partials       1471     1471           
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø)
agent-service 99.32% <ø> (ø) Carriedforward from 9b6f7a3
amber 89.90% <ø> (ø) Carriedforward from 9b6f7a3
computing-unit-managing-service 73.67% <ø> (ø)
config-service 87.12% <ø> (ø)
file-service 87.91% <ø> (ø)
frontend 96.78% <ø> (ø) Carriedforward from 9b6f7a3
notebook-migration-service 83.57% <ø> (ø)
pyamber 98.47% <ø> (ø) Carriedforward from 9b6f7a3
workflow-compiling-service 77.19% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 4 better · 🔴 3 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main d0ab10d benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 406 0.248 23,392/30,426/30,426 us 🟢 -20.9% / 🔴 +90.2%
🟢 bs=100 sw=10 sl=64 810 0.494 121,729/136,570/136,570 us 🟢 -20.0% / 🔴 +27.1%
🔴 bs=1000 sw=10 sl=64 905 0.552 1,107,159/1,216,497/1,216,497 us 🔴 +9.2% / 🔴 +18.6%
Baseline details

Latest main d0ab10d from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 406 tuples/sec 409 tuples/sec 766.26 tuples/sec -0.7% -47.0%
bs=10 sw=10 sl=64 MB/s 0.248 MB/s 0.25 MB/s 0.468 MB/s -0.8% -47.0%
bs=10 sw=10 sl=64 p50 23,392 us 21,589 us 12,778 us +8.4% +83.1%
bs=10 sw=10 sl=64 p95 30,426 us 38,447 us 15,999 us -20.9% +90.2%
bs=10 sw=10 sl=64 p99 30,426 us 38,447 us 19,376 us -20.9% +57.0%
bs=100 sw=10 sl=64 throughput 810 tuples/sec 807 tuples/sec 995.11 tuples/sec +0.4% -18.6%
bs=100 sw=10 sl=64 MB/s 0.494 MB/s 0.492 MB/s 0.607 MB/s +0.4% -18.7%
bs=100 sw=10 sl=64 p50 121,729 us 116,927 us 100,433 us +4.1% +21.2%
bs=100 sw=10 sl=64 p95 136,570 us 170,705 us 107,435 us -20.0% +27.1%
bs=100 sw=10 sl=64 p99 136,570 us 170,705 us 119,856 us -20.0% +13.9%
bs=1000 sw=10 sl=64 throughput 905 tuples/sec 929 tuples/sec 1,025 tuples/sec -2.6% -11.7%
bs=1000 sw=10 sl=64 MB/s 0.552 MB/s 0.567 MB/s 0.626 MB/s -2.6% -11.8%
bs=1000 sw=10 sl=64 p50 1,107,159 us 1,079,553 us 984,108 us +2.6% +12.5%
bs=1000 sw=10 sl=64 p95 1,216,497 us 1,114,108 us 1,025,832 us +9.2% +18.6%
bs=1000 sw=10 sl=64 p99 1,216,497 us 1,114,108 us 1,052,745 us +9.2% +15.6%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,492.02,200,128000,406,0.248,23392.26,30425.66,30425.66
1,100,10,64,20,2470.12,2000,1280000,810,0.494,121728.60,136569.56,136569.56
2,1000,10,64,20,22108.22,20000,12800000,905,0.552,1107159.47,1216497.16,1216497.16

@xuang7

xuang7 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for picking this up. The fix looks good to me. #7800, which predates this issue, updates the same file to use a per-use-site seeded Random.

Tagging @aglinxinyuan, the author of #7800 and the reporter of this issue, for reference so we can decide whether to keep this fix separately.

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mengw15

mengw15 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Superseded by #7800, which repairs the same four Random sites in this file along with the two other spec defects from #7799. #8150 turned out to be a narrower re-file of one item already covered there — the duplicate issue is on our side, not yours.

One note worth recording: #7800 creates a fresh Random(Seed) at each use site rather than sharing one instance-level generator. testJoin is called by most of the 15 tests, so with a shared generator each test's values depend on how many draws ran before it — two identical full-suite runs match, but testOnly *IntervalOpExecSpec -- -z "1k" still gets different inputs than the full run, which is the reproducibility case #8150 was about.

Closing in favour of #7800. Thanks for the fix and for the before/after coverage runs.

@mengw15 mengw15 closed this Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common fix release/v1.2 back porting to release/v1.2 release/v1.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IntervalOpExecSpec uses an unseeded global Random, making failures unreproducible

6 participants