Skip bin/obj when copying repo for integ-test packaging#2466
Open
GarrettBeatty wants to merge 1 commit into
Open
Skip bin/obj when copying repo for integ-test packaging#2466GarrettBeatty wants to merge 1 commit into
GarrettBeatty wants to merge 1 commit into
Conversation
The RuntimeSupport integration test fixture copies the entire repo root into a temp directory (in CicdRelease mode) so dotnet lambda package can resolve the test apps' ProjectReferences. The recursive copy indiscriminately grabbed bin/ and obj/ build outputs. When the integration test projects run in parallel, a concurrent build or Roslyn loading an analyzer (e.g. the newly added Amazon.Lambda.DurableExecution.Analyzers) holds those files open, causing File.CopyTo to throw 'being used by another process' and failing all 24 tests during fixture initialization. Skip bin/obj (alongside the existing .vs skip) — dotnet lambda package regenerates them anyway, so excluding them removes the lock contention and speeds up the copy.
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 RuntimeSupport integration tests were failing 24/24 in CI (run) during fixture initialization with:
Root cause
In
CicdRelease(non-DEBUG) mode,LambdaToolsHelper.GetTempTestAppDirectoryrecursively copies the entire repo root into a temp directory sodotnet lambda packagecan resolve the test apps'..\..\..\src\...ProjectReferences. That recursive copy indiscriminately grabbed everybin/andobj/folder.The integration test projects run in parallel (
run-integ-tests-parallel.ps1). When one project's fixture copies the tree while a concurrent build — or Roslyn loading an analyzer — holds abin/objfile open,File.CopyTothrows "being used by another process". This surfaced now because the newly addedAmazon.Lambda.DurableExecution.Analyzersproject (#2443) is an analyzer whose outputs get loaded/locked during concurrent builds.Fix
Skip
binandobjduring the copy (alongside the existing.vsskip).dotnet lambda packageregenerates these anyway, so excluding them removes the lock contention and makes the copy faster.Testing
Amazon.Lambda.DurableExecution.Analyzersin Release so itsbin/contained the locked-file outputs.RestApiStreamingTests.StreamingEndpoint_ContentTypeIsTextPlain) which exercises the exact fixture copy+package path that was throwing. It now initializes cleanly and passes (real CloudFormation stack deployed to us-west-2, cleaned up afterward).Test-only change — no change file needed.