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 18, 2019
1 parent 8aed6cc commit 75c7df2
Show file tree
Hide file tree
Showing 2 changed files with 64 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":[
]
}
54 changes: 54 additions & 0 deletions createdump-aspnet/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

# WARNING: This kills off all dotnet processes on the system at the end

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

set -x

version="$1"

dotnet new --force web
# 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 2

pids=$(pgrep dotnet)

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 2
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 75c7df2

Please sign in to comment.