Skip to content

Commit

Permalink
e2e: deflake TestCtlV3AuthGracefulDisable
Browse files Browse the repository at this point in the history
We should call Wait for grpc-proxy process stop before start. Otherwise,
the tcp port won't be released.

Fixes: etcd-io#14926

Signed-off-by: Wei Fu <fuweid89@gmail.com>
  • Loading branch information
fuweid authored and wafuwafu13 committed Jan 5, 2023
1 parent eb04fa2 commit 6996591
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/framework/e2e/cluster_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,21 @@ func (pp *proxyProc) Stop() error {
if pp.proc == nil {
return nil
}
if err := pp.proc.Stop(); err != nil && !strings.Contains(err.Error(), "exit status 1") {
// v2proxy exits with status 1 on auto tls; not sure why
err := pp.proc.Stop()
if err != nil {
return err
}

err = pp.proc.Close()
if err != nil {
// proxy received SIGTERM signal
if !(strings.Contains(err.Error(), "unexpected exit code") ||
// v2proxy exits with status 1 on auto tls; not sure why
strings.Contains(err.Error(), "exit status 1")) {

return err
}
}
pp.proc = nil
<-pp.donec
pp.donec = make(chan struct{})
Expand Down

0 comments on commit 6996591

Please sign in to comment.