@@ -29,27 +29,6 @@ async function setProvisionedConcurrency(functionName, concurrency) {
2929 }
3030}
3131
32- async function removeProvisionedConcurrency ( functionName ) {
33- console . log ( `Removing provisioned concurrency for function: ${ functionName } ` ) ;
34-
35- const command = new DeleteProvisionedConcurrencyConfigCommand ( {
36- FunctionName : functionName ,
37- Qualifier : LAMBDA_QUALIFIER ,
38- } ) ;
39-
40- try {
41- await lambdaClient . send ( command ) ;
42- console . log ( `Provisioned concurrency removed successfully` ) ;
43- } catch ( error ) {
44- if ( error . name === 'ResourceNotFoundException' ) {
45- console . log ( `No provisioned concurrency configuration found (already removed)` ) ;
46- } else {
47- console . error ( `Failed to remove provisioned concurrency:` , error . message ) ;
48- throw error ;
49- }
50- }
51- }
52-
5332async function waitForProvisionedConcurrency ( functionName , maxWaitTime = 180000 ) {
5433 console . log ( `Waiting for provisioned concurrency to become ready` ) ;
5534
@@ -103,20 +82,14 @@ async function warmupLambda() {
10382 if ( isReady ) {
10483 console . log ( `Keeping Lambda warm for ${ WARMUP_DURATION_MS } ms...` ) ;
10584 await new Promise ( resolve => setTimeout ( resolve , WARMUP_DURATION_MS ) ) ;
106- console . log ( 'Warmup completed!' ) ;
85+ console . log ( 'Warmup completed! Lambda is ready for performance tests. ' ) ;
10786 } else {
10887 console . log ( 'Proceeding with performance tests even though warmup didn\'t fully complete.' ) ;
10988 }
11089
11190 } catch ( error ) {
11291 console . error ( 'Warmup failed:' , error . message ) ;
11392 throw error ;
114- } finally {
115- try {
116- await removeProvisionedConcurrency ( FUNCTION_NAME ) ;
117- } catch ( cleanupError ) {
118- console . error ( 'Failed to clean up provisioned concurrency:' , cleanupError . message ) ;
119- }
12093 }
12194}
12295
0 commit comments