← Back to Pull requests

test(e2e): run SparkConnect query on the Connect server, not a local … #3239

Closed
unknown closed this pull request without merging on Oct 15, 2026 23:49 UTC
View on GitHub
unknown unknown commented on Oct 14, 2026 00:53 UTC
Author

Purpose of this PR

Fixes #3238

test/e2e/sparkconnect_query_test.go ran its query in spark-shell --master 'local[1]'. In Spark 4.x, SparkSession.builder() defaults to the Classic implementation, and .remote() only sets a config key. So getOrCreate() returned the REPL's local session, and the query never reached the Spark Connect server. The test would pass even with no server running.

Proposed changes:

  • Run the query in the Spark Connect REPL (spark-shell --remote sc://<svc>:15002). Its spark session is bound to the server.

  • Wrap the REPL in script -qec so the Ammonite REPL gets the /dev/tty it needs under kubectl exec -i.

  • Assert SESSION_CLASS=org.apache.spark.sql.connect.SparkSession, so the test fails if the query falls back to a local session.
  • Change Category

  • Bugfix (non-breaking change which fixes an issue)

  • Feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that could affect existing functionality)

  • Documentation update
  • Rationale

    Checked locally against Spark 4.0.4 with a standalone Connect server:

  • The old script got org.apache.spark.sql.classic.SparkSession with app name Spark shell, and the server logged no requests.

  • spark-shell --remote with piped stdin and no TTY fails with cannot open /dev/tty.

  • Under script -qec, it got org.apache.spark.sql.connect.SparkSession, reported the server's app name, and printed ROW_COUNT=100 and VALIDATE=14.
  • Checklist

  • I have conducted a self-review of my own code.

  • I have updated documentation accordingly.

  • I have added tests that prove my changes are effective or that my feature works.

  • Existing unit tests pass locally with my changes.
  • Additional Notes

    go vet and gofmt are clean in test/e2e. I haven't run the e2e suite on kind locally; I'm relying on CI for that.

    Diff: 241 lines (+180 / -61) across 3 files Reviewer: tariq-hasan Review duration: 2816m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 241 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.328
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3239"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 38.8% (MEDIUM) · Higher = larger blast radius
    38.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.8% · Safe to merge
    16.8%