Skip to content

[Internal] Refactoring live-tests to reduce flakiness#45216

Merged
FabianMeiswinkel merged 28 commits into
Azure:mainfrom
FabianMeiswinkel:users/fabianm/LiveTestsImprovements
May 11, 2025
Merged

[Internal] Refactoring live-tests to reduce flakiness#45216
FabianMeiswinkel merged 28 commits into
Azure:mainfrom
FabianMeiswinkel:users/fabianm/LiveTestsImprovements

Conversation

@FabianMeiswinkel

@FabianMeiswinkel FabianMeiswinkel commented May 6, 2025

Copy link
Copy Markdown
Member

Description

This PR is an attempt to significantly reduce flakiness of our live-tests. In the past it has been often necessary to re-run live tests - sometimes multiple times due to test issues.

What has been done in this PR:

  • Pushed faul-injection tests into its own pipeline - tehse tests take quite a bit of time and by definition have slightly higher flakiness
  • Refactored the fault-injection tests to isolate different test groups into their own file (easier to debug)
  • Fixed issues in ClientMetricsTests due to corrupted test-state by pushing various class-level fields into its own type that has a clearly defined lifecycle
  • Implemented three RetryAnalyzers (one specifically for splits, one for sometimes flaky tests and one allowing significantly more retries)
  • Marked tests regularly failing due to flakiness with appropriate RetryAnalyzers

Some additional work left:

  • Monitoring individual pipelines and split those taking >60 minutes regularly (especially Circuit breaker live tests are taking > 2 hours still)
  • Marking any missed flaki tests with appropriate retryAnalyzer annotation

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@FabianMeiswinkel FabianMeiswinkel requested review from a team and kirankumarkolli as code owners May 6, 2025 14:00
@github-actions github-actions Bot added the Cosmos label May 6, 2025
@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - kafka

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - spark

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

2 similar comments
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - kafka

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - spark

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

2 similar comments
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - kafka

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - spark

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

2 similar comments
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - kafka

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - spring

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - spark

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - kafka

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - spark

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

2 similar comments
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - kafka

@FabianMeiswinkel

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - spark

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

2 similar comments
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel FabianMeiswinkel merged commit 2551f4c into Azure:main May 11, 2025
tvaron3 added a commit to tvaron3/azure-sdk-for-java that referenced this pull request Jul 10, 2026
These change-feed tests are known-flaky (see Azure#48064, Azure#45216); running on
shared fixed accounts surfaces transient 408/429/503 more often during
forced partition splits and change-feed setup.

- Broaden SplitTestsRetryAnalyzer to retry not only SplitTimeoutException
  but also a transient CosmosException (408/429/503) anywhere in the cause
  chain, so verifyLeasesOnRestart_AfterSplit tolerates the 503s a split
  legitimately produces.
- Add FlakyTestRetryAnalyzer to readFeedDocumentsStartFromCustomDateForMultiWrite_test
  (pkversion + epkversion) and ChangeFeedTest.changesFromPartitionKey_AfterInsertingNewDocuments,
  matching the precedent set for their sibling CFP tests in Azure#48064.

No production SDK code or default client behavior is changed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants