Skip to content

Commit

Permalink
Fix nil pointer errors on unit test failure (#605)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Cathcart <[email protected]>
  • Loading branch information
robsdedude authored Oct 4, 2024
1 parent 5ebc91d commit 54c9d19
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions neo4j/internal/bolt/bolt3server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ func newBolt3Server(conn net.Conn) *bolt3server {
out: &outgoing{
chunker: newChunker(),
packer: packstream.Packer{},
onPackErr: func(err error) {
panic(err)
},
onIoErr: func(_ context.Context, err error) {
panic(err)
},
},
reader: racing.NewRacingReader(bufio.NewReaderSize(conn, DefaultReadBufferSize)),
}
Expand Down Expand Up @@ -221,6 +227,7 @@ func setupBolt3Pipe(t *testing.T) (net.Conn, *bolt3server, func()) {
}

addr := l.Addr()
fmt.Println("Test server listening on", addr.String())
clientConn, _ := net.Dial(addr.Network(), addr.String())

srvConn, err := l.Accept()
Expand Down
7 changes: 7 additions & 0 deletions neo4j/internal/bolt/bolt4server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ func newBolt4Server(conn net.Conn) *bolt4server {
out: &outgoing{
chunker: newChunker(),
packer: packstream.Packer{},
onPackErr: func(err error) {
panic(err)
},
onIoErr: func(_ context.Context, err error) {
panic(err)
},
},
}
}
Expand Down Expand Up @@ -292,6 +298,7 @@ func setupBolt4Pipe(t *testing.T) (net.Conn, *bolt4server, func()) {
}

addr := l.Addr()
fmt.Println("Test server listening on", addr.String())
clientConn, _ := net.Dial(addr.Network(), addr.String())

srvConn, err := l.Accept()
Expand Down
7 changes: 7 additions & 0 deletions neo4j/internal/bolt/bolt5server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func newBolt5Server(conn net.Conn) *bolt5server {
out: &outgoing{
chunker: newChunker(),
packer: packstream.Packer{},
onPackErr: func(err error) {
panic(err)
},
onIoErr: func(_ context.Context, err error) {
panic(err)
},
},
}
}
Expand Down Expand Up @@ -313,6 +319,7 @@ func setupBolt5Pipe(t *testing.T) (net.Conn, *bolt5server, func()) {
}

addr := l.Addr()
fmt.Println("Test server listening on", addr.String())
clientConn, _ := net.Dial(addr.Network(), addr.String())

srvConn, err := l.Accept()
Expand Down

0 comments on commit 54c9d19

Please sign in to comment.