Skip to content

Increase testTimeoutSeconds to 1800 for Dataflow streaming ValidatesRunner suites - #41255

Closed
damccorm wants to merge 1 commit into
masterfrom
fix/dataflow-streaming-vr-test-timeout
Closed

damccorm wants to merge 1 commit into
masterfrom
fix/dataflow-streaming-vr-test-timeout

Conversation

@damccorm

@damccorm damccorm commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:

  • The PR is an appropriate fix for the issue (e.g. we're not changing a test to avoid a bug)
  • The PR is a simple fix to the issue (e.g. we're not adding infra when we could just modify a test)
  • The PR is not covering for other problems (e.g. if we're bumping timeouts, it is not because we're covering for a performance problem)

Full details of the methodology of generation and review can be found here - https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing

If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)

Summary

Increases --testTimeoutSeconds from 900 (15 minutes) to 1800 (30 minutes) for the validatesRunnerStreaming and validatesRunnerV2Streaming Gradle tasks in runners/google-cloud-dataflow-java/build.gradle.

Root Cause

;tldr: we changed our approach to how we run these tests, and now are running many more in parallel. That + capacity issues means that we might need to wait for a while for Dataflow jobs to start. More (AI-generated) details below in the details section.

I was initially skeptical, but I think the parallel test strategy makes sense, and I think this is a reasonable reaction to the stockout issues that is then being impacted by.

Details
  • Prior to PR #40292 (43bd833c88a, merged Sep 30), each of the 12 Gradle test worker JVMs (--max-workers=12) executed @Test methods sequentially (12 concurrent streaming Dataflow jobs).
  • PR #40292 introduced BeamParallelJunit4Runner (parallelThreads = 6), PR #40303 (248548d64f0) merged batch ValidatesRunner tests into shared Dataflow jobs (testBatching = true for batch only, leaving streaming tests at 1 standalone Dataflow job per test), and PR #40952 (3fd91ba05b8, merged Nov 2) reduced streaming parallelThreads from 6 to 2 while also updating TestDataflowRunner in streaming mode to tolerate transient stockout retries ("The service will retry").
  • With 12 Gradle worker JVMs * 2 parallelThreads = 24 concurrent streaming Dataflow jobs in us-central1 (2x the pre-Improve ValidatesRunner performance. Parallelize runs #40292 concurrency of 12 jobs, plus PostCommit Java ValidatesRunner Dataflow V2 triggering at the same 06:30 UTC cron schedule), individual streaming jobs experience Dataflow queueing or worker pool teardown delays that consume most of the 15-minute (testTimeoutSeconds = 900) wall-clock timeout:
    • In run 43281087492 (job 2026-11-12_11_56_13-3714750566918859942), the job was created at 19:56:13Z and sat in JOB_STATE_QUEUED for 12m40s waiting for regional capacity before Dataflow started worker pool setup at 20:08:53Z; the worker began receiving work at 20:10:55Z, leaving only 19s before testTimeoutSeconds = 900 cancelled it at 20:11:14Z.
    • In run 43169620883 (job 2026-11-11_23_51_12-457120166125553798), the job was created at 07:51:13Z, finished processing all elements and started auto-draining (Stopping worker pool...) at 07:55:03Z (3m50s after creation), but GCE worker pool teardown under concurrent load took 12 minutes (07:55:03Z -> 08:07:06Z), reaching JOB_STATE_DONE at 08:07:38Z (16m25s total, 85s after testTimeoutSeconds = 900 cancelled it at 08:06:14Z).

@damccorm damccorm added the test-failure-cleanup Automated test health and flake cleanup PRs label Nov 12, 2026
@damccorm

Copy link
Copy Markdown
Contributor Author

/gemini review

@github-actions github-actions Bot added runners dataflow size/xs XS: <10 lines changed labels Nov 12, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review Summary

This PR increases --testTimeoutSeconds from the 900s default to 1800s for the Dataflow streaming ValidatesRunner suites (validatesRunnerStreamingConfig and validatesRunnerV2Streaming). This prevents false-negative test timeouts when streaming jobs spend extended time in JOB_STATE_QUEUED or worker pool startup under high concurrency.

🔍 General Feedback

  • The configuration change in runners/google-cloud-dataflow-java/build.gradle is clean, minimal, and properly propagates to all legacy and Runner V2 streaming ValidatesRunner tasks.
  • Increasing this bound does not impact normal execution time or error termination latency since TestDataflowRunner.CancelOnError still immediately cancels jobs that emit error logs.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@damccorm damccorm added the ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review label Nov 13, 2026
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.16%. Comparing base (268f76a) to head (0eab29f).
⚠️ Report is 27 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #41255   +/-   ##
=========================================
  Coverage     57.16%   57.16%           
  Complexity     2291     2291           
=========================================
  Files          1132     1132           
  Lines        181012   181012           
  Branches       1487     1487           
=========================================
  Hits         103483   103483           
  Misses        74985    74985           
  Partials       2544     2544           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@damccorm
damccorm marked this pull request as ready for review November 13, 2026 13:13
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @shunping added as fallback since no labels match configuration
Backup reviewer: Abacn (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Abacn

Abacn commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

This is unlikely fix the issue. If 15 minutes not sufficient to finish a ValidatesRunner it's almost likely due to deadlocks. If there were a test needs to take more than 15 miuntes, we should fix the test

@Abacn

Abacn commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Parallel tests not yet implemented in Streaming. We can hold on and wait for #41000 gets in

@damccorm

Copy link
Copy Markdown
Contributor Author

This is unlikely fix the issue. If 15 minutes not sufficient to finish a ValidatesRunner it's almost likely due to deadlocks. If there were a test needs to take more than 15 miuntes, we should fix the test

Did you look at the jobs mentioned in the description (under details)? I think both of those would’ve passed with this change - the problem is we’re queueing more jobs, leading to capacity issues. I think our options are either run serially (seems not worth it) or be more tolerant to longer stock outs (which this does)

@Abacn

Abacn commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Checked 2026-11-12_11_56_13-3714750566918859942. If it's stockout there would be a log like "Startup of the worker pool in zone [...] failed to bring up any of the desired workers" and retrying, but this job doesn't. So this isn't a stockout.

I also checked job per project quota never exceeds (or near) in the past 14 days. So it isn't too many jobs in queue either.

It's possible intermittent service side hiccup, and it happens infrequently. But I don't think it worth bump timeout which may undermine detections of other regressions in the future

@damccorm

Copy link
Copy Markdown
Contributor Author

Checked 2026-11-12_11_56_13-3714750566918859942. If it's stockout there would be a log like "Startup of the worker pool in zone [...] failed to bring up any of the desired workers" and retrying, but this job doesn't. So this isn't a stockout.

I also checked job per project quota never exceeds (or near) in the past 14 days. So it isn't too many jobs in queue either.

It's possible intermittent service side hiccup, and it happens infrequently. But I don't think it worth bump timeout which may undermine detections of other regressions in the future

Ok - I’m not sure, but let’s leave it for now. I’ll be afk for a week, and at that point I can gather more data on how many runs this would have helped.

@damccorm

Copy link
Copy Markdown
Contributor Author

waiting on author

@damccorm

Copy link
Copy Markdown
Contributor Author

Ok, here's some more analysis. Over the last 3 weeks, increasing --testTimeoutSeconds from 900 (15m) to 1800 (30m) would have resolved 11 out of 19 failing runs across the 4 Java Dataflow streaming ValidatesRunner workflows (V2 Streaming, Streaming, Streaming TagEncodingV2, and Streaming Engine). There were 123 total runs (excluding cancelled ones) across master/PRs, so that's a failure rate of just under 10% from this issue alone. These kicked off a bunch of jobs, so there aren't actually that many jobs running over 15 minutes, but it is also reasonably common if we're launching many jobs.

With that said, I don't see many failures since #41000. So this is probably safe to close for now.

Actions Run Workflow Dataflow Job(s) Why It Took So Long & Why 30m Would Have Succeeded
44371137833 (2026-11-18) PostCommit Java ValidatesRunner Dataflow V2 Streaming 2026-11-18_12_17_18-9037439544795745521 Why it took so long: Initial job setup took 2m40s before starting workers, actual pipeline execution took 1m00s and worker teardown 2m17s (Worker pool stopped at 7m48s), but Dataflow control-plane finalization from Worker pool stopped to JOB_STATE_DONE took 7m16s.
Why it would have succeeded: The 15m timeout fired at 15m00s (cancel rejected with Job has no backend assigned) just 5 seconds before the job reached JOB_STATE_DONE at 15m05s.
43627318697 (2026-11-14) PostCommit Java ValidatesRunner Dataflow V2 Streaming 2026-11-14_11_06_02-1471861719258595283
2026-11-14_11_21_05-12238116940137496404
Why it took so long: Job 1 executed in 1m13s, then spent 6m07s tearing down the worker pool (including a Data Lineage creation failure retry) and 6m02s in post-teardown control-plane finalization. Job 2 sat queued for 14m47s waiting for Dataflow to begin starting workers.
Why it would have succeeded: Job 1 reached JOB_STATE_DONE at 15m22s (22s past the 15m timeout). Job 2 had just raised its worker (15m10s) when the 15m timeout cancelled it 20s later; with ~5–6m needed for normal execution + teardown (~21m total), both jobs fit comfortably inside 30m.
43483913897 (2026-11-13) PostCommit Java ValidatesRunner Dataflow V2 Streaming 2026-11-13_11_29_34-12358323714026586966 Why it took so long: Sat queued in Dataflow for 14m54s before Starting 1 workers was logged under concurrent ValidatesRunner load.
Why it would have succeeded: Autoscaling had just raised the worker (15m16s) when the 15m timeout cancelled the job 1 second later (15m17s). With ~5–6m of normal runtime + teardown (~21m total), it would have finished well within 30m.
43426424491 (2026-11-13) PostCommit Java ValidatesRunner Dataflow Streaming 2026-11-13_05_00_57-15426495990209419656
2026-11-13_06_08_55-3974420416307610625
Why it took so long: Job 1 sat queued for 17m27s before starting workers (execution took 56s). Job 2 executed in 53s (Stopping worker pool at 4m39s), then GCE worker pool teardown took 11m26s.
Why it would have succeeded: Both jobs ran with zero pipeline errors and actually reached JOB_STATE_DONE on Dataflow — Job 1 in 22m33s (its 15m cancel was rejected as not yet ready for canceling) and Job 2 in 16m37s, both well under 30m.
43281087492 (2026-11-12) PostCommit Java ValidatesRunner Dataflow V2 Streaming 2026-11-12_11_56_13-3714750566918859942 Why it took so long: Sat queued in Dataflow for 12m58s waiting for capacity before Starting 1 workers began.
Why it would have succeeded: The worker finished startup and began receiving work at 14m42s with no errors, leaving only 37s before the 15m timeout cancelled it at 15m19s. With ~1m30s of work + teardown (~19–20m total), it would have completed well inside 30m.
43169620883 (2026-11-12) PostCommit Java ValidatesRunner Dataflow V2 Streaming 2026-11-11_23_51_12-457120166125553798 Why it took so long: Started normally and finished all pipeline work in 1m26s (Stopping worker pool at 3m50s), but GCE worker pool teardown took 12m02s under concurrent load.
Why it would have succeeded: The 15m timeout cancelled the job at 15m00s while it was already draining, and it still reached JOB_STATE_DONE 85 seconds later at 16m25s.
43099515506 (2026-11-11) PostCommit Java ValidatesRunner Dataflow Streaming TagEncodingV2 2026-11-11_13_39_02-16588217081775945788 Why it took so long: Sat queued in Dataflow for 14m13s before Starting 1 workers began.
Why it would have succeeded: The worker had just finished booting (Workers have started successfully at 15m26s) when the 15m timeout cancelled it 3 seconds later (15m30s). Normal execution + teardown (~4–5m, ~20m total) fits well within 30m.
42218791663 (2026-11-06) PostCommit Java ValidatesRunner Dataflow Streaming 2026-11-06_05_10_27-12111851165448775558 Why it took so long: Finished all pipeline work in 51s (Stopping worker pool at 2m34s), then took 6m04s for worker teardown (including a Data Lineage creation failure retry) plus 6m03s for control-plane finalization.
Why it would have succeeded: The job actually reached JOB_STATE_DONE at 14m41s, but TestDataflowRunner.waitUntilFinish(900s) exited its backoff polling loop right at 15m00s before observing the terminal state (its cancel request returned Job has terminated in state SUCCESS). With a 30m timeout, the next poll would have observed JOB_STATE_DONE.
41981795731 (2026-11-05) PostCommit Java ValidatesRunner Dataflow V2 Streaming 2026-11-04_23_27_41-5461883482857657522
2026-11-05_00_12_07-13775522409422773950
Why it took so long: Job 1 finished work in 1m24s (Stopping worker pool at 3m27s), then GCE worker pool teardown took 12m11s. Job 2 sat queued for 11m25s before starting workers, then finished work in 1m14s (Stopping worker pool at 14m16s) and hit the 15m timeout 45s into teardown.
Why it would have succeeded: Both jobs completed all assertions cleanly and reached JOB_STATE_DONE on Dataflow — Job 1 in 16m10s and Job 2 in 16m57s — both well inside 30m.
41907461102 (2026-11-04) PostCommit Java ValidatesRunner Dataflow Streaming TagEncodingV2 2026-11-04_13_27_50-1408594198522052572 Why it took so long: Sat queued in Dataflow for 17m31s before Starting 1 workers began (once started, pipeline work took 1m27s and teardown 2m16s).
Why it would have succeeded: The 15m cancel at 15m00s was rejected (Job is not yet ready for canceling), and the job ran to completion as JOB_STATE_DONE in 23m28s — well within 30m.
41578976970 (2026-11-03) PostCommit Java ValidatesRunner Dataflow Streaming Engine 2026-11-02_21_06_43-15297362608436154050 Why it took so long: Started normally and finished all pipeline work in 1m30s (Stopping worker pool at 3m28s), then GCE worker pool teardown took 12m10s.
Why it would have succeeded: The 15m timeout fired at 15m00s during teardown, and the job still reached JOB_STATE_DONE 70 seconds later at 16m10s.

@damccorm damccorm closed this Nov 23, 2026
@damccorm
damccorm deleted the fix/dataflow-streaming-vr-test-timeout branch November 23, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dataflow Next Action: Reviewers ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review runners size/xs XS: <10 lines changed test-failure-cleanup Automated test health and flake cleanup PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants