Skip to content

Commit

Permalink
fix (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
nic-6443 committed Dec 21, 2021
1 parent 99fe3dd commit 984cde1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
14 changes: 14 additions & 0 deletions test/e2e/chaos/chaos.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package chaos

import (
Expand Down
15 changes: 8 additions & 7 deletions test/e2e/scaffold/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,14 @@ func (s *Scaffold) afterEach() {
func runWithRecover(f func()) {
defer func() {
r := recover()
if r != nil {
err, ok := r.(error)
if ok {
// just ignore already closed channel
if strings.Contains(err.Error(), "close of closed channel") {
return
}
if r == nil {
return
}
err, ok := r.(error)
if ok {
// just ignore already closed channel
if strings.Contains(err.Error(), "close of closed channel") {
return
}
}
panic(r)
Expand Down

0 comments on commit 984cde1

Please sign in to comment.