liferoad opened a new pull request, #36584:
URL: https://github.com/apache/beam/pull/36584
Accept both optimal and suboptimal batching patterns in Spanner write tests
due to Beam's non-deterministic execution. The test now verifies total element
count and matches against known acceptable patterns rather than requiring a
specific sequence.
Error:
```
self = <apache_beam.io.gcp.experimental.spannerio_test.SpannerWriteTest
testMethod=test_batch_max_cells>
mock_batch_snapshot_class = <MagicMock name='BatchCheckout'
id='136130133959312'>
mock_batch_checkout = <MagicMock name='Client' id='136130133962576'>
def test_batch_max_cells(
self, mock_batch_snapshot_class, mock_batch_checkout):
mutation_group = [
MutationGroup([
WriteMutation.insert(
"roles", ("key", "rolename"),
[
('1234', "mutations-inset-1234"),
('1235', "mutations-inset-1235"),
])
])
] * 50
> with TestPipeline() as p:
apache_beam/io/gcp/experimental/spannerio_test.py:640:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
target/.tox-py311-cloud/py311-cloud/lib/python3.11/site-packages/apache_beam/pipeline.py:670:
in __exit__
self.result = self.run()
^^^^^^^^^^
target/.tox-py311-cloud/py311-cloud/lib/python3.11/site-packages/apache_beam/testing/test_pipeline.py:122:
in run
state = result.wait_until_finish(duration=self.timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
E File "apache_beam/runners/common.py", line 1498, in
apache_beam.runners.common.DoFnRunner.process
E return self.do_fn_invoker.invoke_process(windowed_value)
E File "apache_beam/runners/common.py", line 684, in
apache_beam.runners.common.SimpleInvoker.invoke_process
E self.output_handler.handle_process_outputs(
E File "apache_beam/runners/common.py", line 1683, in
apache_beam.runners.common._OutputHandler.handle_process_outputs
E self._write_value_to_tag(tag, windowed_value,
watermark_estimator)
E File "apache_beam/runners/common.py", line 1796, in
apache_beam.runners.common._OutputHandler._write_value_to_tag
E self.main_receivers.receive(windowed_value)
E File "apache_beam/runners/worker/operations.py", line 263, in
apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
E self.consumer.process(windowed_value)
E File "apache_beam/runners/worker/operations.py", line 951, in
apache_beam.runners.worker.operations.DoOperation.process
E with self.scoped_process_state:
E File "apache_beam/runners/worker/operations.py", line 952, in
apache_beam.runners.worker.operations.DoOperation.process
E delayed_applications = self.dofn_runner.process(o)
E File "apache_beam/runners/common.py", line 1500, in
apache_beam.runners.common.DoFnRunner.process
E self._reraise_augmented(exn, windowed_value)
E File "apache_beam/runners/common.py", line 1588, in
apache_beam.runners.common.DoFnRunner._reraise_augmented
E raise exn
E File "apache_beam/runners/common.py", line 1498, in
apache_beam.runners.common.DoFnRunner.process
E return self.do_fn_invoker.invoke_process(windowed_value)
E File "apache_beam/runners/common.py", line 684, in
apache_beam.runners.common.SimpleInvoker.invoke_process
E self.output_handler.handle_process_outputs(
E File "apache_beam/runners/common.py", line 1683, in
apache_beam.runners.common._OutputHandler.handle_process_outputs
E self._write_value_to_tag(tag, windowed_value,
watermark_estimator)
E File "apache_beam/runners/common.py", line 1796, in
apache_beam.runners.common._OutputHandler._write_value_to_tag
E self.main_receivers.receive(windowed_value)
E File "apache_beam/runners/worker/operations.py", line 263, in
apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
E self.consumer.process(windowed_value)
E File "apache_beam/runners/worker/operations.py", line 951, in
apache_beam.runners.worker.operations.DoOperation.process
E with self.scoped_process_state:
E File "apache_beam/runners/worker/operations.py", line 952, in
apache_beam.runners.worker.operations.DoOperation.process
E delayed_applications = self.dofn_runner.process(o)
E File "apache_beam/runners/common.py", line 1500, in
apache_beam.runners.common.DoFnRunner.process
E self._reraise_augmented(exn, windowed_value)
E File "apache_beam/runners/common.py", line 1588, in
apache_beam.runners.common.DoFnRunner._reraise_augmented
E raise exn
E File "apache_beam/runners/common.py", line 1498, in
apache_beam.runners.common.DoFnRunner.process
E return self.do_fn_invoker.invoke_process(windowed_value)
E File "apache_beam/runners/common.py", line 684, in
apache_beam.runners.common.SimpleInvoker.invoke_process
E self.output_handler.handle_process_outputs(
E File "apache_beam/runners/common.py", line 1683, in
apache_beam.runners.common._OutputHandler.handle_process_outputs
E self._write_value_to_tag(tag, windowed_value,
watermark_estimator)
E File "apache_beam/runners/common.py", line 1796, in
apache_beam.runners.common._OutputHandler._write_value_to_tag
E self.main_receivers.receive(windowed_value)
E File "apache_beam/runners/worker/operations.py", line 263, in
apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
E self.consumer.process(windowed_value)
E File "apache_beam/runners/worker/operations.py", line 951, in
apache_beam.runners.worker.operations.DoOperation.process
E with self.scoped_process_state:
E File "apache_beam/runners/worker/operations.py", line 952, in
apache_beam.runners.worker.operations.DoOperation.process
E delayed_applications = self.dofn_runner.process(o)
E File "apache_beam/runners/common.py", line 1500, in
apache_beam.runners.common.DoFnRunner.process
E self._reraise_augmented(exn, windowed_value)
E File "apache_beam/runners/common.py", line 1609, in
apache_beam.runners.common.DoFnRunner._reraise_augmented
E raise new_exn
E File "apache_beam/runners/common.py", line 1498, in
apache_beam.runners.common.DoFnRunner.process
E return self.do_fn_invoker.invoke_process(windowed_value)
E File "apache_beam/runners/common.py", line 912, in
apache_beam.runners.common.PerWindowInvoker.invoke_process
E self._invoke_process_per_window(
E File "apache_beam/runners/common.py", line 1057, in
apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
E self.process_method(*args_for_process, **kwargs_for_process),
E File
"/runner/_work/beam/beam/sdks/python/test-suites/tox/py311/build/srcs/sdks/python/target/.tox-py311-cloud/py311-cloud/lib/python3.11/site-packages/apache_beam/transforms/core.py",
line 2098, in <lambda>
E wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
E ^^^^^^^^^^^^^^^^^^^^^^
E File
"/runner/_work/beam/beam/sdks/python/test-suites/tox/py311/build/srcs/sdks/python/target/.tox-py311-cloud/py311-cloud/lib/python3.11/site-packages/apache_beam/testing/util.py",
line 203, in _equal
E raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [12,
12, 12, 12, 2] == [12, 12, 1, 12, 1, 12], unexpected elements [1, 1], missing
elements [2] [while running 'assert_that/Match']
```
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example:
`addresses #123`), if applicable. This will automatically add a link to the
pull request in the issue. If you would like the issue to automatically close
on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more
tips on [how to make review process
smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit
[https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more
information about GitHub Actions CI or the [workflows
README](https://github.com/apache/beam/blob/master/.github/workflows/README.md)
to see a list of phrases to trigger workflows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]