Skip to content

Skip bin/obj when copying repo for integ-test packaging#2466

Open
GarrettBeatty wants to merge 1 commit into
devfrom
fix/integ-test-copy-locked-bin-obj
Open

Skip bin/obj when copying repo for integ-test packaging#2466
GarrettBeatty wants to merge 1 commit into
devfrom
fix/integ-test-copy-locked-bin-obj

Conversation

@GarrettBeatty

Copy link
Copy Markdown
Contributor

Problem

The RuntimeSupport integration tests were failing 24/24 in CI (run) during fixture initialization with:

System.IO.IOException : The process cannot access the file
'.../Amazon.Lambda.DurableExecution.Analyzers/bin/Release/netstandard2.0/Amazon.Lambda.DurableExecution.Analyzers.runtimeconfig.json'
because it is being used by another process.

Root cause

In CicdRelease (non-DEBUG) mode, LambdaToolsHelper.GetTempTestAppDirectory recursively copies the entire repo root into a temp directory so dotnet lambda package can resolve the test apps' ..\..\..\src\... ProjectReferences. That recursive copy indiscriminately grabbed every bin/ and obj/ 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 a bin/obj file open, File.CopyTo throws "being used by another process". This surfaced now because the newly added Amazon.Lambda.DurableExecution.Analyzers project (#2443) is an analyzer whose outputs get loaded/locked during concurrent builds.

Fix

Skip bin and obj during the copy (alongside the existing .vs skip). dotnet lambda package regenerates these anyway, so excluding them removes the lock contention and makes the copy faster.

Testing

  • Reproduced CI state by building Amazon.Lambda.DurableExecution.Analyzers in Release so its bin/ contained the locked-file outputs.
  • Ran a Release-mode integration test (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.

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.
@GarrettBeatty GarrettBeatty added the Release Not Needed Add this label if a PR does not need to be released. label Jul 7, 2026
@GarrettBeatty GarrettBeatty marked this pull request as ready for review July 8, 2026 00:06
@GarrettBeatty GarrettBeatty requested review from a team as code owners July 8, 2026 00:06
@GarrettBeatty GarrettBeatty requested review from normj and philasmar July 8, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release Not Needed Add this label if a PR does not need to be released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant