0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-12 03:19:36 +03:00

Fix flaky TestVMessDynamicPort (#723)

This commit is contained in:
yuhan6665
2021-09-23 23:59:00 -04:00
committed by GitHub
parent a149c78a4c
commit 9f9059c7b1
2 changed files with 111 additions and 51 deletions

View File

@ -143,6 +143,23 @@ func CloseAllServers(servers []*exec.Cmd) {
})
}
func CloseServer(server *exec.Cmd) {
log.Record(&log.GeneralMessage{
Severity: log.Severity_Info,
Content: "Closing server.",
})
if runtime.GOOS == "windows" {
server.Process.Kill()
} else {
server.Process.Signal(syscall.SIGTERM)
}
server.Process.Wait()
log.Record(&log.GeneralMessage{
Severity: log.Severity_Info,
Content: "Server closed.",
})
}
func withDefaultApps(config *core.Config) *core.Config {
config.App = append(config.App, serial.ToTypedMessage(&dispatcher.Config{}))
config.App = append(config.App, serial.ToTypedMessage(&proxyman.InboundConfig{}))