Skip to content

Commit

Permalink
Verify that createdump works on ASP.NET Core
Browse files Browse the repository at this point in the history
This was recently fixed upstream.

See: https://github.com/dotnet/coreclr/issues/21484
  • Loading branch information
omajid committed Feb 20, 2019
1 parent b9a013d commit 7a78c2a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
10 changes: 10 additions & 0 deletions createdump-aspnet/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "createdump-aspnet",
"enabled": true,
"version": "2.0",
"versionSpecific": false,
"type": "bash",
"cleanup": true,
"platformBlacklist":[
]
}
53 changes: 53 additions & 0 deletions createdump-aspnet/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Enable "unofficial bash strict mode"
set -euo pipefail

set -x

version="$1"

dotnet new web --force
# The tool install command can fail because the tool is already installed
# so ignore that. We will fail later on if the tool can't be executed.
dotnet tool install -g dotnet-dev-certs || true
dotnet dev-certs https

# Do not kick off compiler servers that hang around after a build
dotnet build -p:UseRazorBuildServer=false -p:UseSharedCompilation=false /m:1

dotnet run --no-build --no-restore &
sleep 5
root_pid=$!

mapfile -t pids < <(pgrep -P "${root_pid}")
pids+=("${root_pid}")

failed=0

dotnet_home="$(dirname "$(readlink -f "$(command -v dotnet)")")"
for pid in "${pids[@]}"; do
if "${dotnet_home}"/shared/Microsoft.NETCore.App/"${version}"*/createdump -f "$(pwd)"/'coredump.%d' "${pid}"; then
echo "createdump worked"
else
echo "createdump failed"
failed=1
fi
done

for pid in "${pids[@]}"; do
kill -s SIGTERM "${pid}"
done
sleep 1
for pid in "${pids[@]}"; do
if ps -p "${pid}"; then
kill "${pid}"
fi
done

if [ ${failed} -eq 1 ]; then
echo "FAIL: createdump failed"
exit 1
fi

echo "PASS: createdump worked"

0 comments on commit 7a78c2a

Please sign in to comment.