Skip to content

Commit

Permalink
Merge pull request #11 from E0001/main
Browse files Browse the repository at this point in the history
删除死循环,优化运行XCTest性能问题
  • Loading branch information
electricbubble authored Jul 22, 2021
2 parents ffd7e6b + 4a0ffa6 commit 1473da6
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions device.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,21 +692,17 @@ func (d *device) XCTest(bundleID string, opts ...XCTestOption) (out <-chan strin
cancelFunc()
})

for {
select {
case <-ctx.Done():
tmSrv1.close()
tmSrv2.close()
xcTestManager1.close()
xcTestManager2.close()
if _err := d.AppKill(pid); _err != nil {
debugLog(fmt.Sprintf("xctest kill: %d", pid))
}
time.Sleep(time.Second)
close(_out)
return
}
<-ctx.Done()
tmSrv1.close()
tmSrv2.close()
xcTestManager1.close()
xcTestManager2.close()
if _err := d.AppKill(pid); _err != nil {
debugLog(fmt.Sprintf("xctest kill: %d", pid))
}
//time.Sleep(time.Second)
close(_out)
return
}()

return _out, cancelFunc, err
Expand Down

0 comments on commit 1473da6

Please sign in to comment.