Isolate integration tests per run to fix concurrent-run flakiness#378
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #378 +/- ##
=======================================
Coverage 53.81% 53.81%
=======================================
Files 16 16
Lines 1403 1403
Branches 134 134
=======================================
Hits 755 755
Misses 608 608
Partials 40 40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
69b4bbf to
8aeae31
Compare
The integration tests all shared a single hard-coded folder (/Testing/Dropbox.Api.Tests) on one shared Dropbox account. Each test's Initialize asserted the folder was empty and Cleanup emptied it, so overlapping CI runs (e.g. several open PRs building at once) raced on the folder's contents. This surfaced as intermittent failures like "Assert.AreEqual failed. Expected:<0>. Actual:<1>", count mismatches, and "path_lookup/not_found" during cleanup. Give each test run its own unique subfolder (/Testing/Dropbox.Api.Tests/<guid>) created in ClassInitialize and removed in a new ClassCleanup, so concurrent runs can no longer see or delete each other's files.
8aeae31 to
4bd1ac9
Compare
cguldner
approved these changes
Jul 7, 2026
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.
Problem
The integration tests all shared a single hard-coded folder (
/Testing/Dropbox.Api.Tests) on one shared Dropbox account. Each test'sInitializeasserted the folder was empty andCleanupemptied it, so overlapping CI runs (e.g. several open PRs building at once) raced on the folder's contents.This surfaced as intermittent, non-reproducible failures such as:
Assert.AreEqual failed. Expected:<0>. Actual:<1>.inInitializeExpected:<3>. Actual:<2>)path_lookup/not_foundduringCleanupmax-parallel: 1only serializes the OS matrix within a single workflow run — it does nothing across separate workflow runs, so concurrent PR builds collided.Fix
Give each test run its own unique subfolder
/Testing/Dropbox.Api.Tests/<guid>, created inClassInitializeand removed in a newClassCleanup. Concurrent runs can no longer see or delete each other's files.Validation (local)
dotnet buildclean;dotnet format --verify-no-changes --severity warnpasses.