forked from redhat-developer/dotnet-regular-tests
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify that createdump works on ASP.NET Core
This was recently fixed upstream. See : https://github.com/dotnet/coreclr/issues/21484
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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":[ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |