shunping opened a new pull request, #38585:
URL: https://github.com/apache/beam/pull/38585
Flaky test:
```
_________________________ MatrixPowerTest.test_basics
__________________________
[gw3] linux -- Python 3.11.15
/runner/_work/beam/beam/sdks/python/test-suites/tox/py311/build/srcs/sdks/python/target/.tox-py311-cloud/py311-cloud/bin/python
self = <apache_beam.examples.matrix_power_test.MatrixPowerTest
testMethod=test_basics>
def test_basics(self):
matrix_path = self.create_temp_file(self.MATRIX_INPUT)
vector_path = self.create_temp_file(self.VECTOR_INPUT)
matrix_power.run((
'--input_matrix=%s --input_vector=%s --exponent=%d
--output=%s.result' %
(matrix_path, vector_path, self.EXPONENT, vector_path)).split())
# Parse result file and compare.
> with open(vector_path + '.result-00000-of-00001') as result_file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E FileNotFoundError: [Errno 2] No such file or directory:
'/runner/_work/beam/beam/sdks/python/test-suites/tox/py311/build/srcs/sdks/python/target/.tox-py311-cloud/py311-cloud/tmp/tmp2mc8u76w.result-00000-of-00001'
apache_beam/examples/matrix_power_test.py:54: FileNotFoundError
```
The test was previously expecting the output to be written to a single file
shard (`.result-00000-of-00001`). Depending on the runner execution details,
the output can be split into multiple shards, resulting in a flaky
FileNotFoundError.
This PR dynamically finds and reads all generated shards matching the prefix
using `glob`, merging their contents before validating against the expected
output.
--
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]