Worker graceful shutdown (#2455)

* add graceful shutdown to worker
This commit is contained in:
Irena Rindos authored and GitHub committed 2022-09-19 09:59:18 -04:00
1 parent a2ef14283b
commit d951e1ebc1
16 files changed
+241 -229

No files matched your search

+7 -1
View File
@@ -301,6 +301,11 @@ type TestSessionConnection struct {
conn net.Conn
}
// Close a test connection
func (t *TestSessionConnection) Close() error {
return t.conn.Close()
}
// Connect returns a TestSessionConnection for a TestSession. Check
// the unexported connect method for the lower-level details.
func (s *TestSession) Connect(
@@ -344,7 +349,8 @@ func (c *TestSessionConnection) testSendRecv(t *testing.T) bool {
t.Log("received error during write", "err", err)
if errors.Is(err, net.ErrClosed) ||
errors.Is(err, io.EOF) ||
errors.Is(err, websocket.CloseError{Code: websocket.StatusPolicyViolation, Reason: "timed out"}) {
errors.Is(err, websocket.CloseError{Code: websocket.StatusPolicyViolation, Reason: "timed out"}) ||
errors.Is(err, websocket.CloseError{Code: websocket.StatusNormalClosure, Reason: ""}) {
return false
}