Skip to content

[Python] Deflake TextIO footer test - #39668

Open
bvolpato wants to merge 1 commit into
apache:masterfrom
bvolpato:bvolpato/fix-textio-footer-flake
Open

[Python] Deflake TextIO footer test#39668
bvolpato wants to merge 1 commit into
apache:masterfrom
bvolpato:bvolpato/fix-textio-footer-flake

Conversation

@bvolpato

@bvolpato bvolpato commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #39639.

TextSinkTest.test_write_pipeline_footer let the runner choose its output shard count even though its assertions expect one trailing footer. Text sinks add the footer to every shard, so a multi-shard run leaves extra footer lines in the combined output.

Use one output shard for this test, matching the adjacent header test. Per-shard header and footer behavior remains covered by test_write_max_bytes_per_shard.

Reproduction

Setting num_shards=5 on current master reproduces the failure deterministically: four footer lines remain after the assertion removes the final footer.

Testing

  • Python 3.13 Gradle/tox targeted test
  • 20 consecutive targeted test runs
  • Related footer, header, max-records-per-shard, and max-bytes-per-shard tests

  • Linked the issue with Fixes #39639.
  • No CHANGES.md entry needed for a test-only change.
  • Change is small and does not require an ICLA.

@bvolpato
bvolpato marked this pull request as ready for review August 7, 2026 02:38
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Failing Test]: Flake in apache_beam.io.textio_test.TextSinkTest testMethod=test_write_pipeline_footer

1 participant