-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Gradle sub-projects to enable parallel running of Kafka tests #26153
Add Gradle sub-projects to enable parallel running of Kafka tests #26153
Conversation
Run Java_Kafka_IO_Direct PreCommit |
Run Java_Kafka_IO_Direct PreCommit |
1 similar comment
Run Java_Kafka_IO_Direct PreCommit |
…projects to enable running tests in parallel
Codecov Report
@@ Coverage Diff @@
## master #26153 +/- ##
==========================================
- Coverage 71.17% 71.15% -0.02%
==========================================
Files 787 787
Lines 103293 103316 +23
==========================================
+ Hits 73516 73518 +2
- Misses 28288 28309 +21
Partials 1489 1489
Flags with carried forward coverage won't be shown. Click here to find out more. see 9 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
run python_runners precommit |
run python_coverage precommit |
run java precommit |
run java_gcp_io_direct precommit |
java precommit failure is a flake |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import org.apache.beam.gradle.kafka.KafkaTestUtilities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have a common.gradle in sdks/java/io/kafka and then build.gradle in kafka-{version} refers to it, like what flink runner support doing: https://github.com/apache/beam/blob/master/runners/flink/1.12/build.gradle
Assigning reviewers. If you would like to opt out of this review, comment R: @Abacn for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
GCP IO test failure is unrelated. We might have a quota issue on Spanner tests? |
That's a known issue with spanner permissions #26208 |
All 4 failures appear to be unrelated flakes |
'"numRecords": "1000",' + | ||
'"keySizeBytes": "10",' + | ||
'"valueSizeBytes": "90"' + | ||
'}', | ||
"--readTimeout=120", | ||
"--kafkaTopic=beam", | ||
"--withTestcontainers=true", | ||
"--kafkaContainerVersion=5.5.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have these as variables that are then concatenated in the pipelineOptions?
//Because this runs many integration jobs in parallel, each of which use a | ||
//container, it can fail locally due to performance limitations on a desktop. | ||
//To avoid this, use --max-workers=N, where N is less than half your CPUs. | ||
//4 is a good start for parallelism without overloading your computer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is concerning to me, especially because Jenkins runs several jobs at the same time. If you run 2 of these jobs (or even worse, 4) on the same Jenkins machine, does the worker fall over?
I wonder if there's a version of this change that does some parallelization by default, but not this much (e.g. it spins up at most 4 containers at once)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are running fine on the Jenkins workers right now. I've tried to limit parallelism to just one sub-project, but I can only manage to configure the entire build to have a max number of workes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take another stab at this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it looks like I can't configure parallelism differently for a subproject.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could add artificial dependencies between some of these tasks, to try and limit parallelism, but that would be a janky fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - I can live without it at first. If we see these tests failing (at a higher than normal rate) with Jenkins infra-like issues, we should consider clawing this back though
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import org.apache.beam.gradle.kafka.KafkaTestUtilities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than having all of these in individual files, could we do this all in a loop from the base gradle file with something like
beam/runners/spark/3/build.gradle
Line 53 in 2325634
tasks.register("sparkVersion${kv.key}Test", Test) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. That is essentially what we had before, and we don't get parallelism with that because tasks within a project can't be run in parallel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the refactor here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly, I wanted to avoid the same lines being repeated and you accomplished that with the shared properties file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but we should definitely monitor these for causing infra failures
all failures are unrelated flakes |
…ache#26153) * add parallel number to gradle.properties * remove unused config, attempt to configure higher parallelism for kafka tests * Create generic task to represent Integration tests. Then, create sub-projects to enable running tests in parallel * extend test timeout to reduce flakyness * add comment for running locally * run spotless * factor kafka integration tests up a level (cherry picked from commit 837733e)
…6153) (#26263) * add parallel number to gradle.properties * remove unused config, attempt to configure higher parallelism for kafka tests * Create generic task to represent Integration tests. Then, create sub-projects to enable running tests in parallel * extend test timeout to reduce flakyness * add comment for running locally * run spotless * factor kafka integration tests up a level (cherry picked from commit 837733e)
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
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, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.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)
See CI.md for more information about GitHub Actions CI.