Skip to content

Commit

Permalink
Display the crash tests stdout live (#5964)
Browse files Browse the repository at this point in the history
## Summary of changes

In the crashtracking installer smoke-tests, display the output as it
comes instead of all at once when it finishes.

## Reason for change

The job sometimes hangs. When it happens, it gets killed after the
timeout elapses, and we see no output because the command didn't
complete.

## Implementation details

Bash.
  • Loading branch information
kevingosse authored Sep 4, 2024
1 parent 2ebf2cb commit d1e7fc3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .azure-pipelines/steps/run-snapshot-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@ steps:
# Run crash tests
- ${{ if and(eq(parameters.isLinux, true), eq(parameters.isNoop, false)) }}:
- bash: |
LOGS=$(${{ parameters.dockerComposePath }} -f $(COMPOSE_PATH) -p ddtrace_$(Build.BuildNumber) run -e dockerTag=$(dockerTag) -e CRASH_APP_ON_STARTUP=1 -e COMPlus_DbgEnableMiniDump=0 ${{ parameters.target }})
echo $LOGS
LOGS=""
while IFS= read -r line
do
echo "$line" # Output the log line to stdout in real-time
LOGS+="$line"$'\n' # Capture each line into LOGS variable
done < <(${{ parameters.dockerComposePath }} -f $(COMPOSE_PATH) -p ddtrace_$(Build.BuildNumber) run -e dockerTag=$(dockerTag) -e CRASH_APP_ON_STARTUP=1 -e COMPlus_DbgEnableMiniDump=0 ${{ parameters.target }})
# check logs for evidence of crash detection in the output
expected="The crash may have been caused by automatic instrumentation"
Expand Down

0 comments on commit d1e7fc3

Please sign in to comment.