summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2018-09-26 16:09:10 -0700
committerGitHub <noreply@github.com>2018-09-26 16:09:10 -0700
commit5addb2d0ca2e845d8bb512eab9b6f221092cafa0 (patch)
treeaadb080b55828f18be102ce341a4bbb5f8108d0f /tests/scripts
parentc7e9526b108c10360b71f7649e118831c54399ea (diff)
parent29025ba85295cf0f1d3a1b45dcbc3be96ad74690 (diff)
downloadcoreclr-5addb2d0ca2e845d8bb512eab9b6f221092cafa0.tar.gz
coreclr-5addb2d0ca2e845d8bb512eab9b6f221092cafa0.tar.bz2
coreclr-5addb2d0ca2e845d8bb512eab9b6f221092cafa0.zip
Merge pull request #20098 from dotnetrt/fix-win-unix-format
[CI] Fix failures in Windows/Linux CI Formatting jobs by force killing all dotnet processess
Diffstat (limited to 'tests/scripts')
-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