Skip to content

fix: add _setupNodeVersion to CDK and E2E test setup functions#3461

Merged
adrianjoshua-strutt merged 1 commit into
mainfrom
fix/add-setupNodeVersion-to-cdk-tests
Apr 7, 2026
Merged

fix: add _setupNodeVersion to CDK and E2E test setup functions#3461
adrianjoshua-strutt merged 1 commit into
mainfrom
fix/add-setupNodeVersion-to-cdk-tests

Conversation

@adrianjoshua-strutt
Copy link
Copy Markdown
Member

Problem

Data Canary alarms are failling because the CDK canary test steps run on Node.js v18.15.0 instead of the configured v24.12.0.

Root Cause

_setupCDKTestsLinux and _setupE2ETestsLinux in shared-scripts.sh load the .nvm cache from S3 via loadCacheFromBuildJob but never call _setupNodeVersion $AMPLIFY_NODE_VERSION to activate NVM. This means the test phases fall back to the Docker image's system Node (v18.15.0).

When lru-cache v11+ was published to npm. This version uses diagnostics_channel.tracingChannel(), which only exists in Node.js >= 20.5.0. Since the test phases were running Node 18, every canary test crashes with:

TypeError: (0 , R.tracingChannel) is not a function

Every other function in shared-scripts.sh correctly calls _setupNodeVersion:

Only _setupCDKTestsLinux and _setupE2ETestsLinux were missing it.

Testing

The build_linux phase already uses _setupNodeVersion successfully with Node 24.12.0 — this change makes the test phases consistent with it.

…inux

The _setupCDKTestsLinux and _setupE2ETestsLinux functions load the .nvm
cache from S3 but never call _setupNodeVersion to activate it. This causes
the test phases to fall back to the Docker image's system Node (v18.15.0)
instead of using the configured AMPLIFY_NODE_VERSION (v24.12.0).

This became a Sev2 when lru-cache v11+ was published to npm, which requires
Node 20+ (uses diagnostics_channel.tracingChannel()). Since the test phases
were running Node 18, all 83 canary alarms fired across all regions.

Every other function in shared-scripts.sh (_buildLinux, _runGqlE2ETests,
_runCanaryTest, _deploy, etc.) already calls _setupNodeVersion — these two
were the only ones missing it.

Also removes the 'yarn config set ignore-engines true' workaround in
_setupE2ETestsLinux which was masking this same underlying issue.
@adrianjoshua-strutt adrianjoshua-strutt requested a review from a team as a code owner April 6, 2026 15:53
@adrianjoshua-strutt adrianjoshua-strutt merged commit 81419e9 into main Apr 7, 2026
8 checks passed
@adrianjoshua-strutt adrianjoshua-strutt deleted the fix/add-setupNodeVersion-to-cdk-tests branch April 7, 2026 11:29
adrianjoshua-strutt added a commit that referenced this pull request Apr 7, 2026
…inux (#3463)

The canary test functions _setupCDKTestsLinux and _setupE2ETestsLinux
never called _setupNodeVersion, causing them to run on the Docker
image's system Node 18.15.0 instead of the configured
AMPLIFY_NODE_VERSION (24.12.0). This worked until lru-cache v11 was
published to npm (~Apr 6 2026 00:00 UTC), which requires
diagnostics_channel.tracingChannel() (Node 20.5+).

This PR adds the missing _setupNodeVersion $AMPLIFY_NODE_VERSION call to
both functions in Gen1 as well

Companion PRs:
- #3461 (main)
- #3462 (release)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants