-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix create amplify installation in canary tests #635
Conversation
🦋 Changeset detectedLatest commit: 80de5ea The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// Force 'create-amplify' installation in npx cache by executing help command | ||
// before tests run. Otherwise, installing 'create-amplify' concurrently | ||
// may lead to race conditions and corrupted npx cache. | ||
await execa('npm', ['create', 'amplify', '--yes', '--', '--help'], { | ||
// Command must run outside of 'amplify-backend' workspace. | ||
cwd: os.homedir(), | ||
stdio: 'inherit', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with @Amplifiyer offline. and logged #637 to seek better solution.
Issue #, if available:
Description of changes:
Fixes race condition that has been showing up in canary tests. I.e. it seems that running
create-amplify
with cold cache can result in corruption.Sample logs:
Test run
https://github.com/aws-amplify/amplify-backend/actions/runs/6853040384/job/18632951365
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.