Skip to content

Commit

Permalink
Don't panic if the server only closed
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Jun 25, 2024
1 parent 8615407 commit 16cfdd7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/libp2phttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package vole

import (
"context"
"fmt"
"net"
"net/http"
"os"
Expand Down Expand Up @@ -38,10 +37,9 @@ func TestHTTPProxyAndServer(t *testing.T) {

go func() {
err := Libp2pHTTPSocketProxy(ctx, serverAddr, socketFile.Name())
if err != nil {
if err != http.ErrServerClosed && err != nil {
panic(err)
}
fmt.Println("err", err)
}()

// Wait a bit to let the proxy start up.
Expand Down Expand Up @@ -108,10 +106,9 @@ func TestHTTPProxyAndServerOverHTTPTransport(t *testing.T) {

go func() {
err := Libp2pHTTPSocketProxy(ctx, serverAddr, socketFile.Name())
if err != nil {
if err != http.ErrServerClosed && err != nil {
panic(err)
}
fmt.Println("err", err)
}()

// Wait a bit to let the proxy start up.
Expand Down

0 comments on commit 16cfdd7

Please sign in to comment.