chore(codebuild): add region constraints and fix fleet deletion timeouts in integ tests#36956
Conversation
|
|
||||||||||||||
|
|
||||||||||||||
128c260 to
a7793c2
Compare
…s in integ tests Several CodeBuild integration tests were failing due to regional availability constraints and fleet resource deletion timeouts. Changes: - Add region constraints to 11 integ tests for features not available in all regions (AWS::CodeBuild::Fleet, Lambda compute, MAC_ARM, WINDOWS_SERVER_2022_CONTAINER) - Remove hardcoded fleetName properties to avoid name collisions - Add destroy.expectError for fleet tests since AWS::CodeBuild::Fleet deletion takes ~40 minutes, exceeding the CFN resource handler's ~21 minute stabilization timeout (NotStabilized) - Increase waitForAssertions timeouts for fleet tests (5->15 min) to account for fleet instance provisioning time - Simplify macOS fleet tests to only verify fleet creation (remove startBuild/batchGetBuilds assertions) since macOS dedicated host provisioning exceeds the assertion framework's timeout limits All 11 tests validated across us-east-1, us-east-2, us-west-2, ap-southeast-2, and eu-central-1.
a7793c2 to
bd71853
Compare
CodeBuild fleet instances have a 1-hour minimum runtime before deletion completes. The CFN resource handler's stabilization timeout is shorter than this, so DELETE always fails with 'Exceeded attempts to wait' (HandlerErrorCode: NotStabilized). The fleet is still cleaned up by CodeBuild after the 1-hour window. Updated comment to accurately explain the root cause.
Abogical
left a comment
There was a problem hiding this comment.
We got the following error when trying to deploy via the workflow:
Running test /codebuild/output/src3758018834/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.project-fleet.js in us-west-2
ERROR /codebuild/output/src3758018834/src/actions-runner/_work/aws-cdk/aws-cdk/packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.project-fleet.js (undefined/us-west-2) 0.001s
Error during integration test: ManifestLoadingError: Failed to load integ manifest 'packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.project-fleet.js.snapshot/integ.json': Cloud assembly schema version mismatch: Maximum schema version supported is 50.x.x, but found 52.0.0. You need at least CLI version 2.1107.0 to read this manifest.
Cause: Error: Cloud assembly schema version mismatch: Maximum schema version supported is 50.x.x, but found 52.0.0. You need at least CLI version 2.1107.0 to read this manifest.
Can this be fixed?
|
@Abogical done, it just needed a merge from main for the latest cdk cli. The issue is now the account is suspended by Codebuild 🫠 |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Merge Queue Status
This pull request spent 42 minutes 45 seconds in the queue, including 42 minutes 32 seconds running CI. Required conditions to merge
|
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #.
Reason for this change
Several CodeBuild integration tests were failing across multiple error categories:
Unrecognized resource types: [AWS::CodeBuild::Fleet]—AWS::CodeBuild::FleetCloudFormation resource is not available in all regionsLambdaCompute feature is not supported in region— Lambda compute mode is only available in 10 regionsRegion X is not supported for WINDOWS_SERVER_2022_CONTAINER— Windows Server 2022 environment type is only available in 8 regionsNotStabilized) —AWS::CodeBuild::Fleetresource deletion takes ~40 minutes, exceeding the CFN resource handler's ~21 minute stabilization timeoutDescription of changes
Region constraints (all 11 tests):
Added
regionsproperty to IntegTest constructors, with per-test comments explaining the specific feature constraint:AWS::CodeBuild::Fleetnot available in all regionsARM_LAMBDA_CONTAINER/LINUX_LAMBDA_CONTAINERnot available in all regionsWINDOWS_SERVER_2022_CONTAINERnot available in all regionsMAC_ARMonly available in 5 regionsWINDOWS_SERVER_2022_CONTAINERnot available in all regionsFleet deletion workaround (8 fleet tests):
Added
cdkCommandOptions.destroy.expectError = truebecauseAWS::CodeBuild::Fleetdeletion consistently takes ~40 minutes, exceeding the CFN resource handler's ~21 minute stabilization timeout (verified via CloudFormation events across multiple regions).Assertion timeout increases (6 fleet tests):
Increased
waitForAssertionstotalTimeoutfrom 5 to 15 minutes for fleet tests to account for fleet instance provisioning time before builds can execute.Hardcoded name removal (5 fleet tests):
Removed hardcoded
fleetNameproperties ('MyFleet','MacOsFleet14','MacOsFleet15') to avoidNAME_COLLISIONon re-runs.macOS test simplification (2 tests):
Removed
startBuild/batchGetBuildsassertions from macOS fleet tests since macOS dedicated host provisioning exceeds the assertion framework's timeout limits. ThelistFleetsassertion is retained to verify fleet creation. Build execution on fleets is already validated by the Linux fleet tests.Describe any new or updated permissions being added
N/A — no permission changes.
Description of how you validated changes
All 11 tests validated via
yarn integwith--force --update-on-failedacross 5 parallel regions:us-east-1,us-east-2,us-west-2,ap-southeast-2,eu-central-1.Validation command:
Not fixed (external dependency):
integ.github-org-webhookandinteg.github-webhook-batchrequire a pre-configured GitHub access token in the AWS account — cannot be fixed in test code.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license