apache / beam

Apache Beam is a unified programming model for Batch and Streaming data processing.
https://beam.apache.org/
Apache License 2.0
7.89k stars 4.27k forks source link

use direct executor to deflake tests #33187

Open m-trieu opened 3 days ago

m-trieu commented 3 days ago

MoreExecutors.directExecutor()/directExecutorService runs all tasks on the calling thread (w/o offloading to another thread for async work) and calls to submit and execute will block until the submitted task returns (i.e Runnable.run()).

Use this in test implementations of ChannelCache and FanOutStreamingEngineWorkerHarness to prevent threads waiting on each other. The old implementation seems to work locally but in the test runner environment has increased in flakiness.

Flakiness is referenced in https://github.com/apache/beam/issues/28957


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels Python tests Java tests Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

github-actions[bot] commented 3 days ago

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