Skip to content

test(amber): cover websocket session state - #7157

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:test/session-state
Jul 31, 2026
Merged

test(amber): cover websocket session state#7157
aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:test/session-state

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds focused unit coverage for websocket event delivery, workflow-service subscription replacement and cleanup, session-map removal, and computing-unit access state.

Any related issues, documentation, discussions?

Closes #7153

How was this PR tested?

  • WorkflowExecutionService/testOnly org.apache.texera.web.SessionStateSpec — 3 succeeded.
  • WorkflowExecutionService/Test/scalafmtCheck and WorkflowExecutionService/Test/scalafix --check.

Mutation proof:

Production mutation Result
Replaced the serialized websocket payload with an empty string 1 test failed
Stopped retaining the subscribed workflow service 1 test failed
Stopped removing a session from the session-state map 1 test failed

Each mutation was reverted before the final green test run.

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

Generated-by: Codex (GPT-5)

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

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

  • No candidates found from git blame history.

@aglinxinyuan
aglinxinyuan marked this pull request as ready for review July 31, 2026 04:16
@aglinxinyuan
aglinxinyuan requested a review from mengw15 July 31, 2026 04:16
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 6 worse · ⚪ 7 noise (<±5%) · 0 without baseline

Compared against main 45b7b20 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 544 0.332 17,217/26,538/26,538 us 🔴 +13.1% / 🔴 +63.8%
🔴 bs=100 sw=10 sl=64 1,216 0.742 83,393/93,447/93,447 us 🟢 -25.9% / 🟢 +26.0%
🔴 bs=1000 sw=10 sl=64 1,434 0.876 697,493/838,437/838,437 us 🔴 +12.8% / 🟢 +44.6%
Baseline details

Latest main 45b7b20 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 544 tuples/sec 589 tuples/sec 765.25 tuples/sec -7.6% -28.9%
bs=10 sw=10 sl=64 MB/s 0.332 MB/s 0.36 MB/s 0.467 MB/s -7.8% -28.9%
bs=10 sw=10 sl=64 p50 17,217 us 15,220 us 12,703 us +13.1% +35.5%
bs=10 sw=10 sl=64 p95 26,538 us 27,825 us 16,199 us -4.6% +63.8%
bs=10 sw=10 sl=64 p99 26,538 us 27,825 us 19,557 us -4.6% +35.7%
bs=100 sw=10 sl=64 throughput 1,216 tuples/sec 1,187 tuples/sec 965.22 tuples/sec +2.4% +26.0%
bs=100 sw=10 sl=64 MB/s 0.742 MB/s 0.725 MB/s 0.589 MB/s +2.3% +25.9%
bs=100 sw=10 sl=64 p50 83,393 us 77,114 us 103,830 us +8.1% -19.7%
bs=100 sw=10 sl=64 p95 93,447 us 126,179 us 110,778 us -25.9% -15.6%
bs=100 sw=10 sl=64 p99 93,447 us 126,179 us 118,713 us -25.9% -21.3%
bs=1000 sw=10 sl=64 throughput 1,434 tuples/sec 1,412 tuples/sec 992.33 tuples/sec +1.6% +44.5%
bs=1000 sw=10 sl=64 MB/s 0.876 MB/s 0.862 MB/s 0.606 MB/s +1.6% +44.6%
bs=1000 sw=10 sl=64 p50 697,493 us 722,815 us 1,016,959 us -3.5% -31.4%
bs=1000 sw=10 sl=64 p95 838,437 us 743,123 us 1,062,501 us +12.8% -21.1%
bs=1000 sw=10 sl=64 p99 838,437 us 743,123 us 1,082,611 us +12.8% -22.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,367.56,200,128000,544,0.332,17217.40,26537.61,26537.61
1,100,10,64,20,1644.92,2000,1280000,1216,0.742,83393.28,93446.51,93446.51
2,1000,10,64,20,13942.78,20000,12800000,1434,0.876,697492.71,838437.00,838437.00

@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.64%. Comparing base (45b7b20) to head (e8282c9).
⚠️ Report is 11 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7157      +/-   ##
============================================
+ Coverage     79.62%   80.64%   +1.02%     
- Complexity     3836     3908      +72     
============================================
  Files          1160     1160              
  Lines         46188    46188              
  Branches       5145     5145              
============================================
+ Hits          36777    37249     +472     
+ Misses         7778     7275     -503     
- Partials       1633     1664      +31     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 03d2b6c
agent-service 77.42% <ø> (ø) Carriedforward from 03d2b6c
amber 75.86% <ø> (+2.77%) ⬆️
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 03d2b6c
config-service 65.97% <ø> (ø) Carriedforward from 03d2b6c
file-service 66.80% <ø> (ø) Carriedforward from 03d2b6c
frontend 83.16% <ø> (ø) Carriedforward from 03d2b6c
notebook-migration-service 78.89% <ø> (ø) Carriedforward from 03d2b6c
pyamber 97.36% <ø> (ø) Carriedforward from 03d2b6c
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from 03d2b6c

*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.

@mengw15 mengw15 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

Copilot AI 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.

Pull request overview

Adds a new Amber unit-test spec to validate server-side websocket session state behavior, aligning with the Amber web layer’s SessionState responsibilities (event delivery + workflow-service subscription lifecycle + session registry + computing-unit privilege state).

Changes:

  • Introduces SessionStateSpec covering websocket JSON event serialization via SessionState.send.
  • Adds coverage for workflow-service subscription replacement / cleanup via SessionState.subscribe + unsubscribe.
  • Adds coverage for session registry operations (setState / getState / removeState) and computing-unit access state behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread amber/src/test/scala/org/apache/texera/web/SessionStateSpec.scala Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
@aglinxinyuan
aglinxinyuan enabled auto-merge July 31, 2026 23:26
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 31, 2026
Merged via the queue into apache:main with commit 2388b85 Jul 31, 2026
21 checks passed
@aglinxinyuan
aglinxinyuan deleted the test/session-state branch July 31, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for websocket session state

4 participants