Skip to content

Commit 9fddf4d

Browse files
authored
fix race condition with e2e process controller (#2600)
* add assertion loggings for troubleshooting * temp disable node 22 * how bout this? * how bout this?
1 parent 7962bc5 commit 9fddf4d

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

.changeset/funny-dolls-live.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/integration-tests/src/process-controller/predicated_action_macros.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const confirmDeleteSandbox = () =>
5151
* then perform the specified file replacements in the backend code which will trigger sandbox again
5252
*/
5353
export const replaceFiles = (replacements: CopyDefinition[]) => {
54-
return waitForSandboxToBecomeIdle().replaceFiles(replacements);
54+
return waitForConfigUpdateAfterDeployment().replaceFiles(replacements);
5555
};
5656

5757
/**

packages/integration-tests/src/test-e2e/sandbox/sandbox.test.template.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
interruptSandbox,
1414
replaceFiles,
1515
waitForConfigUpdateAfterDeployment,
16+
waitForSandboxToBecomeIdle,
1617
waitForSandboxToBeginHotswappingResources,
1718
} from '../../process-controller/predicated_action_macros.js';
1819
import { BackendIdentifier } from '@aws-amplify/plugin-types';
@@ -109,6 +110,7 @@ export const defineSandboxTest = (testProjectCreator: TestProjectCreator) => {
109110
ensureDeploymentTimeLessThan(update.deployThresholdSec),
110111
);
111112
}
113+
processController.do(waitForSandboxToBecomeIdle());
112114
}
113115

114116
// Execute the process.

packages/integration-tests/src/test-project-setup/data_storage_auth_with_triggers.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,14 @@ class DataStorageAuthWithTriggerTestProject extends TestProjectBase {
286286
defaultNodeLambdaTypedShimPath,
287287
'utf8',
288288
);
289-
assert.ok(fileContent.includes('newKey: string;')); // Env var added via addEnvironment
290-
assert.ok(fileContent.includes('TEST_SECRET: string;')); // Env var added via defineFunction
289+
assert.ok(
290+
fileContent.includes('newKey: string;'),
291+
`file content was ${fileContent}`,
292+
); // Env var added via addEnvironment
293+
assert.ok(
294+
fileContent.includes('TEST_SECRET: string;'),
295+
`file content was ${fileContent}`,
296+
); // Env var added via defineFunction
291297

292298
// assert specific config are correct in the outputs file
293299
const outputsObject = JSON.parse(

0 commit comments

Comments
 (0)