Skip to content

Skip registry client test if registry is not reachable - #5980

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
miminar:flake-5559
Nov 25, 2015
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
miminar:flake-5559

Conversation

@miminar

@miminar miminar commented Nov 20, 2015

Copy link
Copy Markdown

Resolves #5559

@miminar

miminar commented Nov 20, 2015

Copy link
Copy Markdown
Author

@stevekuznetsov could you please take a look?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you show sample output we'll get from hack/test-integration.sh? I'm not completely comfortable with the idea of skipping these, but I don't know for sure that I'm opposed either.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the jUnit integration is in we'll be able to easily see skips. This is nice.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hack/test-integration.sh shows just ok:

$ printf "127.0.0.2 index.docker.io docker.io" >> /etc/hosts
$ ./hack/test-integration.sh '^TestRegistry'

Test test/integration -tags='integration !docker etcd' ...

Building test executable...
Starting etcd...
etcd: {"etcdserver":"2.1.1","etcdcluster":"2.1.0"}
{"message":"Internal Server Error"}
ok      TestRegistryClientConnect
ok      TestRegistryClientConnectPulpRegistry
ok      TestRegistryClientDockerHubV2
...

I can see the skip message only when I run the tests manually:

$ go test -test.run TestRegistryClient -v ./test/integration/dockerregistryclient_test.go 
=== RUN TestRegistryClientConnect
--- PASS: TestRegistryClientConnect (0.00s)
=== RUN TestRegistryClientConnectPulpRegistry
--- PASS: TestRegistryClientConnectPulpRegistry (3.71s)
=== RUN TestRegistryClientDockerHubV2
--- SKIP: TestRegistryClientDockerHubV2 (0.00s)
        dockerregistryclient_test.go:48: skipping due to unreachable registry index.docker.io: Get https://index.docker.io/v2/: dial tcp 127.0.0.2:443: connection refused
=== RUN TestRegistryClientDockerHubV1
...

I'll shorten the skip message a bit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hack/test-integration.sh shows just ok:

You'll need to update that to indicate the skip.

@miminar

miminar commented Nov 20, 2015

Copy link
Copy Markdown
Author

Issues addressed. Example output:

./hack/test-integration.sh '^TestRegistry'

Test test/integration -tags='integration !docker etcd' ...

Building test executable...
Starting etcd...
etcd: {"etcdserver":"2.1.1","etcdcluster":"2.1.0"}
{"message":"Internal Server Error"}
skipped TestRegistryClientConnect
        dockerregistryclient_test.go:57: skipping due to unreachable registry: Get https://index.docker.io/v2/: dial tcp 127.0.0.2:443: connection refused
skipped TestRegistryClientConnectPulpRegistry
        dockerregistryclient_test.go:57: skipping due to unreachable registry: Get https://registry.access.redhat.com/v2/: dial tcp 127.0.0.2:443: connection refused
ok      TestRegistryClientDockerHubV1
skipped TestRegistryClientDockerHubV2
        dockerregistryclient_test.go:57: skipping due to unreachable registry: Get https://index.docker.io/v2/: dial tcp 127.0.0.2:443: connection refused
ok      TestRegistryClientImageV1
skipped TestRegistryClientImageV2
        dockerregistryclient_test.go:57: skipping due to unreachable registry: Get https://index.docker.io/v2/: dial tcp 127.0.0.2:443: connection refused
ok      TestRegistryClientQuayIOImage
ok      TestRegistryClientRegistryNotFound

real    0m10.082s
user    0m1.169s
sys     0m0.308s
./hack/test-integration.sh took 40 seconds

Complete

@deads2k

deads2k commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

@miminar I might should have led with this. Do you see this as something we'll turn on in the merge queue (I'd probably tend towards no, but I think @bparees is the most affected) or do you see as something for your local runs.

Since test-cmd.sh will fail without dockerhub connectivity, I assumed this was for local invocations, but you defaulted the env-var to "allow skip"

@deads2k

deads2k commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

@miminar what about a retry on some kinds of failure instead of a skip?

Comment thread hack/test-integration.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the skip check inside the if ${result} -eq 0... skips should qualify a 0 return code that would otherwise be reported as success, not excuse a non-zero return code

@liggitt

liggitt commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

I don't want any "skip if unavailable" tests running in the merge queue... we need to be able to know what tests are running. I'm also concerned what skipping this test could allow into master. Do we have alternative tests we could do that don't depend on dockerhub? Do we need to move this into extended tests instead (and skip the check, so we know when it fails)?

@bparees

bparees commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

@deads2k not clear why i'm affected by this?

but i agree with everything else that's been said that it's a bad idea...certainly as a default.

@miminar

miminar commented Nov 23, 2015

Copy link
Copy Markdown
Author

Since test-cmd.sh will fail without dockerhub connectivity, I assumed this was for local invocations, but you defaulted the env-var to "allow skip"

My concern is a flake #5559. That's why I defaulted to skip.

what about a retry on some kinds of failure instead of a skip?

@deads2k it might occasionally help.

Do we have alternative tests we could do that don't depend on dockerhub? Do we need to move this into extended tests instead (and skip the check, so we know when it fails)?

@liggitt the problematic registry is our registry.access.redhat.com. There's no connection issue in recent Jenkins history to Docker hub. But I think they should be treated the same way.

Moving the tests to extended seems reasonable to me. @deads2k, @bparees any objections?

@deads2k

deads2k commented Nov 23, 2015

Copy link
Copy Markdown
Contributor

Moving the tests to extended seems reasonable to me. @deads2k, @bparees any objections?

Let's try the retry first. Extended tests don't get much attention.

@miminar

miminar commented Nov 24, 2015

Copy link
Copy Markdown
Author

@deads2k Ok, rewritten.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, might need a test for the test. I can definitely see the intent, but I can't say with certainty that this fulfills the intent. @liggitt can you read it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) ok, I'll split it with into few strings.Contains() tests.

Update: Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return an error in this case

@deads2k

deads2k commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

I think I'll like it after the API tweak

Retry only for network related failures.

Signed-off-by: root <[email protected]>
@miminar

miminar commented Nov 24, 2015

Copy link
Copy Markdown
Author

@deads2k addressed. Thanks for patience :).

@deads2k

deads2k commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

lgtm [merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/4148/) (Image: devenv-rhel7_2802)

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to ea9de51

@openshift-bot

Copy link
Copy Markdown
Contributor

[Test]ing while waiting on the merge queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants