提交 907318a6 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

wait for ztf service to exit before client terminated

上级 7b8c0033
......@@ -142,23 +142,33 @@ export class ZtfApp {
}
bindElectronEvents() {
app.on('activate', () => {
logInfo('>> event: activate');
this.buildAppMenu();
// 在 OS X 系统上,可能存在所有应用窗口关闭了,但是程序还没关闭,此时如果收到激活应用请求,需要重新打开应用窗口并创建应用菜单。
this.openOrCreateWindow()
});
app.on('window-all-closed', () => {
logInfo(`>> event: window-all-closed`)
app.quit();
});
app.on('quit', () => {
logInfo(`>> event: quit`)
this.quit();
});
app.on('will-quit', (e) => {
e.preventDefault()
app.on('activate', () => {
logInfo('>> event: activate');
logInfo(`>> event: app will-quit`)
this.buildAppMenu();
logInfo(`>> start to kill child process`)
this.quit();
logInfo(`>> end to kill child process`)
// 在 OS X 系统上,可能存在所有应用窗口关闭了,但是程序还没关闭,此时如果收到激活应用请求,需要重新打开应用窗口并创建应用菜单。
this.openOrCreateWindow()
app.exit()
});
app.on('quit', () => {
logInfo(`>> event: app quit`)
});
}
......
......@@ -122,19 +122,15 @@ export function killZtfServer() {
logInfo(`>> not windows`);
const cmd = `ps -ef | grep ${uuid} | grep -v "grep" | awk '{print $2}' | xargs -r kill -9`
logInfo(`>> exit cmd: ${cmd}`);
// const cp = require('child_process');
// cp.exec(cmd, function (error, stdout, stderr) {
// logInfo(`>> exit result: stdout: ${stdout}; stderr: ${stderr}; error: ${error}`);
// });
logInfo(`>> kill ztf service cmd: ${cmd}`);
const stdout = execSync(cmd, {windowsHide: true}).toString().trim()
logInfo(`>> exit result: ${stdout}`)
logInfo(`>> kill ztf service result: ${stdout}`)
} else {
const cmd = 'Get-WmiObject -class win32_process -filter "Commandline like \'%%' + uuid + '%%\'" | Select-Object Processid, Caption';
logInfo(`>> list process cmd: ${cmd}`);
const stdout = execSync(cmd, {windowsHide: true, shell:'powershell.exe'}).toString().trim()
logInfo(`>> list process result: exec ${cmd}, stdout: ${stdout}`)
......@@ -159,10 +155,10 @@ export function killZtfServer() {
if (pid && pid > 0) {
const killCmd = `taskkill /F /pid ${pid}`
logInfo(`>> exit cmd: exec ${killCmd}`)
logInfo(`>> kill ztf service cmd: exec ${killCmd}`)
const stdout = execSync(`taskkill /F /pid ${pid}`, {windowsHide: true}).toString().trim()
logInfo(`>> exit result: ${stdout}`)
logInfo(`>> kill ztf service result: ${stdout}`)
}
}
}
\ No newline at end of file
......@@ -36,6 +36,9 @@ func (s *TestExecService) Start(req serverDomain.ExecReq, wsMsg *websocket.Messa
execHelper.PopulateTestSetPropsWithParentRequest(&req)
for idx, _ := range req.TestSets {
testSet := &req.TestSets[idx]
if testSet.TestTool == "robotframework" {
testSet.TestTool = commConsts.RobotFramework
}
if testSet.WorkspaceId != 0 {
po, _ := s.WorkspaceService.Get(uint(testSet.WorkspaceId))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册