Skip to content

Commit eb81854

Browse files
author
Davide Melfi
committed
chore: fixing the script
1 parent a4317b7 commit eb81854

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

experimental/aws-lambda-java-profiler/integration_tests/create_function.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ LAYER_ARN=$(cat /tmp/layer_arn)
1010

1111
JAVA_TOOL_OPTIONS="-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -javaagent:/opt/profiler-extension.jar"
1212
AWS_LAMBDA_PROFILER_RESULTS_BUCKET_NAME="aws-lambda-java-profiler-bucket-${GITHUB_RUN_ID}"
13-
AWS_LAMBDA_PROFILER_START_COMMAND="start,event=wall,interval=1us"
14-
AWS_LAMBDA_PROFILER_STOP_COMMAND="stop,file=%s,include=*AWSLambda.main,include=start_thread"
13+
AWS_LAMBDA_PROFILER_START_COMMAND="start,event=wall,interval=1us,file=/tmp/profile.jfr"
14+
AWS_LAMBDA_PROFILER_STOP_COMMAND="stop,file=%s"*Issue #, if available:*
1515

1616
# Compile the Hello World project
1717
cd integration_tests/helloworld

experimental/aws-lambda-java-profiler/integration_tests/invoke_function_custom_options.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ FUNCTION_NAME_CUSTOM_PROFILER_OPTIONS="aws-lambda-java-profiler-function-custom-
55
PAYLOAD='{"key": "value"}'
66

77
# Expected profiler commands (should match create_function.sh)
8-
EXPECTED_START_COMMAND="start,event=wall,interval=1us"
9-
EXPECTED_STOP_COMMAND="stop,file=%s,include=*AWSLambda.main,include=start_thread"
8+
EXPECTED_START_COMMAND="start,event=wall,interval=1us,file=/tmp/profile.jfr"
9+
EXPECTED_STOP_COMMAND="stop,file=%s"*Issue #, if available:*
1010

1111
echo "Invoking Lambda function with custom profiler options: $FUNCTION_NAME_CUSTOM_PROFILER_OPTIONS"
1212

@@ -37,13 +37,14 @@ echo "Function output:"
3737
cat output.json
3838

3939
# Verify profiler started
40-
echo "$LOG_RESULT" | base64 --decode | grep "starting the profiler for coldstart" || exit 1
40+
echo "$LOG_RESULT" | base64 --decode | grep "starting the profiler for coldstart" || { echo "ERROR: Profiler did not start for coldstart"; exit 1; }
4141

4242
# Verify custom start command is being used
43-
echo "$LOG_RESULT" | base64 --decode | grep "$EXPECTED_START_COMMAND" || exit 1
43+
echo "$LOG_RESULT" | base64 --decode | grep "$EXPECTED_START_COMMAND" || { echo "ERROR: Expected start command not found: $EXPECTED_START_COMMAND"; exit 1; }
44+
echo "$LOG_RESULT" | base64 --decode | grep "$EXPECTED_STOP_COMMAND" || { echo "ERROR: Expected stop command not found: $EXPECTED_STOP_COMMAND"; exit 1; }
4445

4546
# Verify no upload on cold start
46-
echo "$LOG_RESULT" | base64 --decode | grep -v "uploading" || exit 1
47+
echo "$LOG_RESULT" | base64 --decode | grep -v "uploading" || { echo "ERROR: Unexpected upload detected on cold start"; exit 1; }
4748

4849
# Clean up the output file
4950
rm output.json
@@ -79,10 +80,10 @@ echo "Function output:"
7980
cat output.json
8081

8182
# Verify upload happens on warm start
82-
echo "$LOG_RESULT" | base64 --decode | grep "uploading" || exit 1
83+
echo "$LOG_RESULT" | base64 --decode | grep "uploading" || { echo "ERROR: Upload not detected on warm start"; exit 1; }
8384

8485
# Verify custom stop command is being used
85-
echo "$LOG_RESULT" | base64 --decode | grep "$EXPECTED_STOP_COMMAND" || exit 1
86+
echo "$LOG_RESULT" | base64 --decode | grep "$EXPECTED_STOP_COMMAND" || { echo "ERROR: Expected stop command not found on warm start: $EXPECTED_STOP_COMMAND"; exit 1; }
8687

8788
# Clean up the output file
8889
rm output.json

0 commit comments

Comments
 (0)