summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacek Blaszczynski <biosciencenow@outlook.com>2018-09-22 01:30:49 +0200
committerJacek Blaszczynski <biosciencenow@outlook.com>2018-09-22 11:37:13 +0200
commit29025ba85295cf0f1d3a1b45dcbc3be96ad74690 (patch)
tree2ef14c59dd03252eef84a55ff2d3ed0e5e1dbbca /tests
parent6410f031da3dd7f25dce79ad29fa348733598df2 (diff)
downloadcoreclr-29025ba85295cf0f1d3a1b45dcbc3be96ad74690.tar.gz
coreclr-29025ba85295cf0f1d3a1b45dcbc3be96ad74690.tar.bz2
coreclr-29025ba85295cf0f1d3a1b45dcbc3be96ad74690.zip
Fix failures in Windows/Linux CI Formatting jobs by killing all dotnet processess
Use shell commands to kill all processess with dotnet/dotnet.exe name before attempting the final cleanup of the CI workspace
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts/format.py15
-rw-r--r--tests/scripts/kill-all.cmd15
2 files changed, 26 insertions, 4 deletions
diff --git a/tests/scripts/format.py b/tests/scripts/format.py
index 7401afd29b..658e7f93e5 100644
--- a/tests/scripts/format.py
+++ b/tests/scripts/format.py
@@ -32,7 +32,7 @@ def del_rw(action, name, exc):
def main(argv):
parser = argparse.ArgumentParser()
required = parser.add_argument_group('required arguments')
- required.add_argument('-a', '--arch', type=str,
+ required.add_argument('-a', '--arch', type=str,
default=None, help='architecture to run jit-format on')
required.add_argument('-o', '--os', type=str,
default=None, help='operating system')
@@ -85,13 +85,13 @@ def main(argv):
print("Downloading .Net CLI")
if platform == 'Linux':
- dotnetcliUrl = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300/dotnet-sdk-2.1.300-linux-x64.tar.gz"
+ dotnetcliUrl = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.402/dotnet-sdk-2.1.402-linux-x64.tar.gz"
dotnetcliFilename = os.path.join(dotnetcliPath, 'dotnetcli-jitutils.tar.gz')
elif platform == 'OSX':
- dotnetcliUrl = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300/dotnet-sdk-2.1.300-osx-x64.tar.gz"
+ dotnetcliUrl = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.402/dotnet-sdk-2.1.402-osx-x64.tar.gz"
dotnetcliFilename = os.path.join(dotnetcliPath, 'dotnetcli-jitutils.tar.gz')
elif platform == 'Windows_NT':
- dotnetcliUrl = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300/dotnet-sdk-2.1.300-win-x64.zip"
+ dotnetcliUrl = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.402/dotnet-sdk-2.1.402-win-x64.zip"
dotnetcliFilename = os.path.join(dotnetcliPath, 'dotnetcli-jitutils.zip')
else:
print('Unknown os ', os)
@@ -227,6 +227,13 @@ def main(argv):
proc = subprocess.Popen(["dotnet", "build-server", "shutdown"], env=my_env)
output,error = proc.communicate()
+ # shutdown all spurious dotnet processes using os shell
+ if platform == 'Linux' or platform == 'OSX':
+ subprocess.call(['killall', '-SIGTERM', '-qw', dotnet])
+ elif platform == 'Windows_NT':
+ utilpath = os.path.join(coreclr, 'tests\\scripts\\kill-all.cmd')
+ subprocess.call([utilpath, dotnet])
+
if os.path.isdir(jitUtilsPath):
print("Deleting " + jitUtilsPath)
shutil.rmtree(jitUtilsPath, onerror=del_rw)
diff --git a/tests/scripts/kill-all.cmd b/tests/scripts/kill-all.cmd
new file mode 100644
index 0000000000..fde8526484
--- /dev/null
+++ b/tests/scripts/kill-all.cmd
@@ -0,0 +1,15 @@
+@if not defined _echo @echo off
+setlocal EnableDelayedExpansion
+
+:kill-process
+set __ProcName=%1
+
+:: Check if __ProcName is running
+tasklist /fi "imagename eq %__ProcName%" |find ":" > nul
+:: __ProcName is running if errorlevel == 1
+if errorlevel 1 (
+ echo Stop %__ProcName% execution.
+ for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq %__ProcName%" /fo csv') do taskkill /f /PID %%~F
+)
+
+exit /b 0