Skip to content

Commit

Permalink
Merge pull request #2428 from artilleryio/fix/ecs-init
Browse files Browse the repository at this point in the history
fix: improve task startup logic for Fargate
  • Loading branch information
hassy authored Jan 18, 2024
2 parents d7109dd + f3ce7e8 commit a0b6328
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,8 @@ async function launchLeadTask(context) {
throw runErr;
}

await awaitOnEE(context.reporterEvents, 'prepack_end', 1000 * 60 * 1);

return context;
}

Expand Down Expand Up @@ -1853,6 +1855,10 @@ async function listen(context, ee) {
console.error('Error processing ensure directive');
}
}

if (body.type === 'leader' && body.msg === 'prepack_end') {
ee.emit('prepack_end');
}
});

r.on('stats', async (stats) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ check_dependencies () {
sync_test_data () {
mkdir "$TEST_DATA"
pushd "$TEST_DATA" >/dev/null
aws s3 sync "$s3_test_data_path" . >/dev/null
aws s3 sync --exclude node_modules_stream.zip "$s3_test_data_path" . >/dev/null

debug "$(pwd)"
debug "$(ls -a)"
Expand Down Expand Up @@ -179,6 +179,7 @@ install_dependencies () {
echo "Modules pre-packaged"
aws s3 mv "$s3_test_data_path/node_modules_stream.zip" "$s3_test_data_path/node_modules.zip"
send_message "leader npm prepack end `date +%s`" "debug"
send_message "prepack_end" "leader"
else
# wait until node_modules.zip is available and unzip, or timeout
# TODO: use aws s3api wait object-exists with a custom timeout
Expand Down

0 comments on commit a0b6328

Please sign in to comment.