summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/testbench/connections.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/packetimpact/testbench/connections.go')
-rw-r--r--test/packetimpact/testbench/connections.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/packetimpact/testbench/connections.go b/test/packetimpact/testbench/connections.go
index c1b3c4380..f84fd8ba7 100644
--- a/test/packetimpact/testbench/connections.go
+++ b/test/packetimpact/testbench/connections.go
@@ -26,6 +26,7 @@ import (
"time"
"github.com/mohae/deepcopy"
+ "go.uber.org/multierr"
"golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/header"
@@ -382,17 +383,15 @@ func (conn *Connection) match(override, received Layers) bool {
// Close frees associated resources held by the Connection.
func (conn *Connection) Close() {
- if err := conn.sniffer.close(); err != nil {
- conn.t.Fatal(err)
- }
- if err := conn.injector.close(); err != nil {
- conn.t.Fatal(err)
- }
+ errs := multierr.Combine(conn.sniffer.close(), conn.injector.close())
for _, s := range conn.layerStates {
if err := s.close(); err != nil {
- conn.t.Fatalf("unable to close %+v: %s", s, err)
+ errs = multierr.Append(errs, fmt.Errorf("unable to close %+v: %s", s, err))
}
}
+ if errs != nil {
+ conn.t.Fatalf("unable to close %+v: %s", conn, errs)
+ }
}
// CreateFrame builds a frame for the connection with layer overriding defaults