Change the order of executors shutdown in drainAndShutdownExecutors to fix flaky integration tests#2884
Merged
0xnm merged 1 commit intoSep 17, 2025
Conversation
…o fix flaky integration tests
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2884 +/- ##
===========================================
- Coverage 70.60% 70.58% -0.02%
===========================================
Files 810 810
Lines 29671 29674 +3
Branches 5081 5081
===========================================
- Hits 20948 20945 -3
- Misses 7295 7297 +2
- Partials 1428 1432 +4
🚀 New features to boost your workflow:
|
aleksandr-gringauz
approved these changes
Sep 17, 2025
0xnm
deleted the
nogorodnikov/change-order-of-executors-shutdown-in-drainAndShutdownExecutors
branch
September 17, 2025 07:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following test is quite flaky
com.datadog.android.sdk.integration.security.EncryptionTest > must_encrypt_all_dataand it may be after we introduced feature context synchronization.I didn't manage to have this test failing on my local machine, but on CI it happens sometimes.
Probably, the issue is related to the way
flushAndShutdownExecutorsdoes the flush/shutdown sequence under the hood, so this PR first makes sure all context thread tasks are processed before shutting down I/O executors (well, mostly considering persistence executor), because tasks on the context thread may spin off tasks for the I/O thread.Hopefully, this will solve the issue, but I'm not 100% sure (since I cannot reproduce it locally).
Review checklist (to be filled by reviewers)