Skip to content

Library test case produces different error than expected in CI #1588

@michael-valdron

Description

@michael-valdron

/kind bug

Which area is this bug related to?

/area ci
/area library

What versions of software are you using?

Go project

Operating System and version: Ubuntu 22.04.4 LTS

Go Pkg Version: 1.21

Bug Summary

Describe the bug:

Library test case Test_parseFromRegistry/should_fail_if_registryUrl_is_invalid produces different error server misbehaving instead of expected no such host. This only seems to happening in the CI, not local test runs of make test, after updating to Go 1.21 and Kubernetes 1.29.

To Reproduce:

One can attempt to reproduce by running make test with a Go 1.21 runtime, so far reproducing this difference in error does not work locally (for me in Fedora 39) where it run with expected error that passes the test case.

To reproduce in CI at the time of writing, produce a branch with updates to library to use Go 1.21 and Kubernete 1.29, including updating the Go runtime version in the workflow, then run the build workflow.

Expected behavior

Error should be the following to match the test case expectation Get .* dial tcp: lookup http: .*:

Get "http://http//invalid.com/devfiles/notexist/": dial tcp: lookup http: no such host

Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable

Currently getting this error in that test case:

Get "http://http//invalid.com/devfiles/notexist/": dial tcp: lookup http on 127.0.0.53:53: server misbehaving

Error Log

=== RUN   Test_parseFromRegistry/should_fail_if_registryUrl_is_invalid
    parse_test.go:4879: 
        	Error Trace:	/home/runner/work/library/library/pkg/devfile/parser/parse_test.go:4879
        	Error:      	Expect "Get "http://http//invalid.com/devfiles/notexist/": dial tcp: lookup http on 127.0.0.53:53: server misbehaving" to match "Get .* dial tcp: lookup http: .*"
        	Test:       	Test_parseFromRegistry/should_fail_if_registryUrl_is_invalid
        	Messages:   	Test_parseFromRegistry(): Error message should match
=== RUN   Test_parseFromRegistry/should_fail_if_registry_returns_a_bad_devfile_content
--- FAIL: Test_parseFromRegistry (1.00s)

Additional context

Any workaround?

Don't make these changes, but this blocks dependencies from updating the Kubernetes version.

Suggestion on how to fix the bug

None yet, needs investigating.

Metadata

Metadata

Labels

area/ciarea/libraryCommon devfile library for interacting with devfileskind/bugSomething isn't working

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions