8000 test(serverlessspark): filter get-batch test to SUCCEEDED batches to prevent flake by DylanVolz · Pull Request #4438 · googleapis/mcp-toolbox · GitHub
[go: up one dir, main page]

Skip to content

test(serverlessspark): filter get-batch test to SUCCEEDED batches to prevent flake - #4438

Open
DylanVolz wants to merge 1 commit into
mainfrom
fix/serverless-spark-test
Open

DylanVolz wants to merge 1 commit into
mainfrom
fix/serverless-spark-test

Conversation

@DylanVolz
Copy link
Copy Markdown
Contributor

Description

Fixes a flake in TestServerlessSparkToolEndpoints/parallel-tool-tests/get-batch in tests/serverlessspark/serverless_spark_integration_test.go.

Previously, get-batch selected a target batch using listBatchesRpc(..., "", 1, true) with no state filter, which picks the most recently created batch in the shared test project. When concurrent CI runs create new batches, the newest batch is often in-flight (PENDING, RUNNING, or CANCELLING) and mutates (State, StateTime, StateHistory, RuntimeInfo) between the test's direct client.GetBatch call and the get-batch tool invocation.

Filtering listBatchesRpc by "state = SUCCEEDED" and moving the baseline client.GetBatch lookup into the subtest ensures the test compares against a batch in a terminal state.

PR Checklist

Thank you for opening a Pull Request! Before submitting your PR, there are a
few things you can do to make sure it goes smoothly:

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure you have manually reviewed the entire diff before requesting a
    review
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

@DylanVolz
DylanVolz requested a review from a team as a code owner November 7, 2026 01:43
@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the Serverless Spark integration tests in 'tests/serverlessspark/serverless_spark_integration_test.go'. It filters the batch list RPC to retrieve only batches with a 'SUCCEEDED' state. Additionally, it refactors 'runGetBatchTest' to fetch the expected batch details inside the test case execution loop rather than beforehand. I have no further feedback to provide as there are no review comments to evaluate.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0