Skip to content

Commit

Permalink
chore: replace t.fatal() with require.NoError()
Browse files Browse the repository at this point in the history
  • Loading branch information
vchandela committed Sep 15, 2024
1 parent 36a4e89 commit d967bfd
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions wait/host_port_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,12 @@ func TestHostPortStrategyFailsWhileInternalCheckingDueToUnexpectedContainerStatu

func TestHostPortStrategySucceedsGivenShellIsNotInstalled(t *testing.T) {
listener, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatal(err)
}
require.NoError(t, err)
defer listener.Close()

rawPort := listener.Addr().(*net.TCPAddr).Port
port, err := nat.NewPort("tcp", strconv.Itoa(rawPort))
if err != nil {
t.Fatal(err)
}
require.NoError(t, err)

target := &MockStrategyTarget{
HostImpl: func(_ context.Context) (string, error) {
Expand Down Expand Up @@ -511,16 +507,12 @@ func TestHostPortStrategySucceedsGivenShellIsNotInstalled(t *testing.T) {

func TestHostPortStrategySucceedsGivenShellIsNotFound(t *testing.T) {
listener, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatal(err)
}
require.NoError(t, err)
defer listener.Close()

rawPort := listener.Addr().(*net.TCPAddr).Port
port, err := nat.NewPort("tcp", strconv.Itoa(rawPort))
if err != nil {
t.Fatal(err)
}
require.NoError(t, err)

target := &MockStrategyTarget{
HostImpl: func(_ context.Context) (string, error) {
Expand Down

0 comments on commit d967bfd

Please sign in to comment.