Fix flaky MatrixPowerTest.test_basics by reading all generated shards#38585
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a recurring flakiness issue in the MatrixPowerTest suite. By implementing a glob-based approach to locate and aggregate all output files matching the expected prefix, the test now correctly handles scenarios where the runner generates multiple shards, ensuring consistent and reliable validation. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the matrix power integration test to handle multiple output shards by using the glob module to aggregate results instead of reading a single hardcoded file. The reviewer suggested adding an assertion to ensure that output shards are actually found, which improves debuggability by preventing the test from proceeding with an empty result set if the pipeline fails to generate output.
|
r: @derrickaw (another flaky test related to asserting text output with different number of shards) |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
Flaky test (https://github.com/apache/beam/actions/runs/26220137898/job/77152699556):
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.Related to #38484