Skip to content

Commit

Permalink
add linux killall comamnd (#1346)
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooolivia authored Jun 5, 2020
1 parent 3a6b5f9 commit 4d87d79
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/scenarios/shared/sdk_iteration_setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import shutil
from shared import const
from shared import const, util
from dotnet import shutdown_server
from performance.logger import setup_loggers
from logging import getLogger
from argparse import ArgumentParser


SETUP_BUILD = 'setup_build'
SETUP_NEW = 'setup_new'
CLEANUP = 'cleanup'
Expand All @@ -19,7 +20,7 @@ def main():
setup_loggers(True)

if args.operation == SETUP_BUILD:
shutdown_server(verbose=True)
shutdown_dotnet_servers()
if not os.path.isdir(const.TMPDIR):
if not os.path.isdir(const.APPDIR):
raise Exception("\'app\' folder should exist. Please run pre.py.")
Expand All @@ -42,5 +43,13 @@ def main():
shutil.rmtree(const.APPDIR)


def shutdown_dotnet_servers():
# shutdown_server(verbose=True) # This is the correct way to shut down dotnet build servers, but it has been disabled due to https://github.com/dotnet/sdk/issues/10573
getLogger().info("Shutting down dotnet build servers...")
if util.iswin():
os.system('TASKKILL /F /T /IM dotnet.exe || TASKKILL /F /T /IM VSTest.Console.exe || TASKKILL /F /T /IM msbuild.exe')
else:
os.system('killall -9 dotnet || killall -9 VSTest.Console || killall -9 msbuild')

if __name__ == "__main__":
main()

0 comments on commit 4d87d79

Please sign in to comment.