beam icon indicating copy to clipboard operation
beam copied to clipboard

[Failing Test]: Four SpannerChangeStreamErrorTest tests are still disabled and fail on stale expectations

Open jonathansudhakar1 opened this issue 1 week ago • 2 comments

What happened?

Four tests in SpannerChangeStreamErrorTest (:sdks:java:io:google-cloud-platform) are still @Ignored on master (d44b8088865):

  • testUnavailableExceptionRetries (L119)
  • testAbortedExceptionRetries (L160)
  • testResourceExhaustedRetry (L224)
  • testInvalidRecordReceived (L288)

#37003 disabled them in December 2025 to unblock the Spanner client upgrade in #36995, and #37002 tracked re-enabling them. The stale bot closed #37002 as not planned on 2026-07-06 without a fix; its assignee's last update there was in January. #21533 (2022) is an older issue about testUnavailableExceptionRetries that #28751 fixed in 2023; it's still open, but it predates this breakage. So nothing open tracks these four tests now, which is why I'm filing a new issue rather than commenting on a closed one.

With the @Ignores removed on d44b8088865, all four fail:

./gradlew :sdks:java:io:google-cloud-platform:test --tests 'org.apache.beam.sdk.io.gcp.spanner.changestreams.SpannerChangeStreamErrorTest'
7 tests completed, 4 failed

They fail on stale test expectations, not on a connector bug:

  • The three retry tests expect DEADLINE_EXCEEDED. readChangeStream().expand() reads the database dialect while the pipeline is constructed (SpannerIO.java#L2404-L2405), so the mock's sticky error fails that query. The current client surfaces the injected status instead:
    Expected: exception with message a string containing "DEADLINE_EXCEEDED"
         but: message was "UNAVAILABLE: io.grpc.StatusRuntimeException: UNAVAILABLE - Statement: 'select option_name, option_value from information_schema.database_options where option_name in ('database_dialect', 'default_transaction_isolation')'"
    
    The other two fail the same way with ABORTED and RESOURCE_EXHAUSTED. The enabled siblings testUnknownExceptionDoesNotRetry and testResourceExhaustedRetryWithDefaultSettings already expect the injected status like this.
  • testInvalidRecordReceived fails with INTERNAL: ... There is no result registered for the statement: select option_value from information_schema.change_stream_options .... It lacks the mockChangeStreamOptions(), mockGetPartitionSize(...) and mockChangePartitionState(...) setup that its enabled twin testInvalidRecordReceivedWithDefaultSettings has.

Proposed fix (test-only): expect the injected status as a SpannerException in the three retry tests; give testInvalidRecordReceived its twin's mocks and expectations (PipelineExecutionException with "Field not found"); and remove the @Ignores. With that change the class passes locally: 7 of 7 tests in each of 6 consecutive runs (the last five with --rerun).

Issue Failure

Failure: Test is continually failing

Issue Priority

Priority: 2 (backlog / disabled test but we think the product is healthy)

Issue Components

  • [ ] Component: Python SDK
  • [x] Component: Java SDK
  • [ ] Component: Go SDK
  • [ ] Component: Typescript SDK
  • [x] Component: IO connector
  • [ ] Component: Beam YAML
  • [ ] Component: Beam examples
  • [ ] Component: Beam playground
  • [ ] Component: Beam katas
  • [ ] Component: Website
  • [ ] Component: Infrastructure
  • [ ] Component: Spark Runner
  • [ ] Component: Flink Runner
  • [ ] Component: Prism Runner
  • [ ] Component: Hazelcast Jet Runner
  • [ ] Component: Google Cloud Dataflow Runner

I'm planning to submit a fix.

jonathansudhakar1 avatar Nov 19 '26 17:11 jonathansudhakar1

.add-labels bug,'awaiting triage','failing test'

jonathansudhakar1 avatar Nov 19 '26 17:11 jonathansudhakar1

.take-issue

jonathansudhakar1 avatar Nov 19 '26 17:11 jonathansudhakar1