Skip to content

Commit fb45cbc

Browse files
committed
test: Remove require.NoError() which will always fail
While testing ignition changes, `make test-unit` fails more often than not because of an error returned by `startIgnitionProvisionerServerInternal` I don’t know if this is triggered by my changes, or by the fact that before df03cab, this test was seldomly run. However, it’s incorrect to assert with `require.NoError(t, err)` after calling `startIgnitionProvisionerServerInternal` as this ends with `return srv.Serve(listener)` which is documented as always failing: https://pkg.go.dev/net/http#Server.Serve > Serve always returns a non-nil error Signed-off-by: Christophe Fergeau <[email protected]>
1 parent 81b71ee commit fb45cbc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cmd/vfkit/main_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ func TestStartIgnitionProvisionerServer(t *testing.T) {
2929

3030
// Start the server using the socket so that it can returns the ignition data
3131
go func() {
32-
err := startIgnitionProvisionerServerInternal(ignitionReader, listener)
33-
require.NoError(t, err)
32+
_ = startIgnitionProvisionerServerInternal(ignitionReader, listener)
3433
}()
3534

3635
// Wait for the socket file to be created before serving, up to 2 seconds

0 commit comments

Comments
 (0)