diff --git a/packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js b/packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js index 98c7caec3e..739c67a374 100644 --- a/packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js +++ b/packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js @@ -1538,6 +1538,8 @@ async function launchLeadTask(context) { throw runErr; } + await awaitOnEE(context.reporterEvents, 'prepack_end', 1000 * 60 * 1); + return context; } @@ -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) => { diff --git a/packages/artillery/lib/platform/aws-ecs/worker/loadgen-worker b/packages/artillery/lib/platform/aws-ecs/worker/loadgen-worker index 94953d3f32..3166a46316 100644 --- a/packages/artillery/lib/platform/aws-ecs/worker/loadgen-worker +++ b/packages/artillery/lib/platform/aws-ecs/worker/loadgen-worker @@ -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)" @@ -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