Skip to content

[AMORO-4303][AMS] Stabilize optimizer heartbeat tests - #4307

Open
johntomcat7408-cmyk wants to merge 1 commit into
apache:masterfrom
johntomcat7408-cmyk:fix-4303-optimizer-heartbeat-test
Open

[AMORO-4303][AMS] Stabilize optimizer heartbeat tests#4307
johntomcat7408-cmyk wants to merge 1 commit into
apache:masterfrom
johntomcat7408-cmyk:fix-4303-optimizer-heartbeat-test

Conversation

@johntomcat7408-cmyk

Copy link
Copy Markdown
Contributor

Why are the changes needed?

Close #4303.

AMSServiceTestBase applied an 800 ms optimizer heartbeat timeout to every optimizer test, while its background toucher only attempted a heartbeat every 300 ms. Under CI scheduling or database delays, tests that were not exercising expiration could lose the optimizer, requeue its task, and fail nondeterministically.

Brief change log

  • Use a 10-second heartbeat timeout for ordinary optimizer tests while retaining an explicit 800 ms timeout in expiration-specific tests.
  • Touch every 100 ms and replace fixed sleeps with condition-based waits for task and optimizer state transitions.
  • Fully dispose and restore test services around custom-timeout scenarios so background keepers cannot leak between tests.
  • Ignore keeper failures only after shutdown has begun, while preserving runtime error logging.

How was this patch tested?

  • Update the existing optimizer service tests to cover normal and expiration-specific timing independently.
  • Add screenshots for manual tests if appropriate (not applicable).
  • Run tests locally before making a pull request.

Validation performed against commit 7efadacadc3561b60ec7c10cc28e91964c29e5a8:

  • JDK 11: full TestDefaultOptimizingService suite (22 tests) passed, followed by 20/20 successful repetitions of testPollTaskThreeTimes.
  • JDK 17: full TestDefaultOptimizingService suite (22 tests) passed, followed by 20/20 successful repetitions of testPollTaskThreeTimes.
  • Spotless, Checkstyle, production compilation, and test compilation passed.

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@github-actions github-actions Bot added the module:ams-server Ams server module label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:ams-server Ams server module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TestDefaultOptimizingService.testPollTaskThreeTimes can fail after optimizer heartbeat expiration

1 participant