Skip to content

[WIP] Build logs retry when etcd watcher expires - #7697

Closed
rhcarvalho wants to merge 4 commits into
openshift:masterfrom
rhcarvalho:start-build-expired-watcher
Closed

rhcarvalho wants to merge 4 commits into
openshift:masterfrom
rhcarvalho:start-build-expired-watcher

Conversation

@rhcarvalho

Copy link
Copy Markdown
Contributor

Experiment to reproduce and fix the issue #7174.

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

[test]

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

[test]

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

I was able to reproduce the error from #7174:

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/12031/console

FAILURE after 1800.694s: hack/../test/cmd/builds.sh:83: executing 'oc start-build --wait --follow busybox' expecting success and text 'hello world': the command returned the wrong error code; the output content test failed
Standard output from the command:
busybox-1
Standard error from the command:
error getting logs: unable to wait for build busybox-1 to run: received unknown object while watching for builds
error: The build cmd-builds/busybox-1 status is "Failed"

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/12032/console

FAILURE after 1800.734s: hack/../test/cmd/builds.sh:83: executing 'oc start-build --wait --follow busybox' expecting success and text 'hello world': the command returned the wrong error code; the output content test failed
Standard output from the command:
busybox-2
Standard error from the command:
error getting logs: unable to wait for build busybox-2 to run: received unknown object while watching for builds
error: The build cmd-builds/busybox-2 status is "Failed"

Things that called my attention:

  • The 30 min waiting for the command to succeed 😴
  • For the same test (line 83) in one case we were waiting for build busybox-1 and in the other busybox-2 😕

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 21, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 4, 2016
@rhcarvalho
rhcarvalho force-pushed the start-build-expired-watcher branch from d4df4b5 to d562512 Compare May 16, 2016 14:47
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2016
@bparees

bparees commented Jun 10, 2016

Copy link
Copy Markdown
Contributor

more orphaned fixes, any chance of revival?

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 10, 2016
@danmcp

danmcp commented Jun 14, 2016

Copy link
Copy Markdown

@rhcarvalho Bump

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

I'll try to have a look at this and others at the end half of the current sprint.

They were previously commented out because of failures when a build
watcher expired.
This allows us to inspect the object in the error and perhaps retry.
@rhcarvalho
rhcarvalho force-pushed the start-build-expired-watcher branch 2 times, most recently from bb74643 to 83d498a Compare June 28, 2016 07:32
@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 83d498a

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

Rebased and trying to re-reproduce the issue.

@rhcarvalho rhcarvalho removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 28, 2016
@rhcarvalho

Copy link
Copy Markdown
Contributor Author

Alright, still failing as before:

Running test/cmd/builds.sh:82: executing 'oc new-build -D "FROM busybox:1"' expecting success...
SUCCESS after 0.406s: test/cmd/builds.sh:82: executing 'oc new-build -D "FROM busybox:1"' expecting success
Running test/cmd/builds.sh:83: executing 'oc get istag busybox:1' expecting any result and text 'busybox@sha256:'; re-trying every 0.2s until completion or 60.000s...
SUCCESS after 0.457s: test/cmd/builds.sh:83: executing 'oc get istag busybox:1' expecting any result and text 'busybox@sha256:'; re-trying every 0.2s until completion or 60.000s
Running test/cmd/builds.sh:84: executing 'oc patch bc/busybox -p '{"spec":{"postCommit":{"script":"echo hello $1","args":["world"],"command":null}}}'' expecting success...
SUCCESS after 0.140s: test/cmd/builds.sh:84: executing 'oc patch bc/busybox -p '{"spec":{"postCommit":{"script":"echo hello $1","args":["world"],"command":null}}}'' expecting success
Running test/cmd/builds.sh:85: executing 'oc get bc/busybox -o=jsonpath="{.spec.postCommit['script','args','command']}"' expecting success and text '^echo hello \$1 \[world\] \[\]$'...
SUCCESS after 0.132s: test/cmd/builds.sh:85: executing 'oc get bc/busybox -o=jsonpath="{.spec.postCommit['script','args','command']}"' expecting success and text '^echo hello \$1 \[world\] \[\]$'
Running test/cmd/builds.sh:86: executing 'oc start-build --wait --follow busybox' expecting success and text 'hello world'...
FAILURE after 3602.043s: test/cmd/builds.sh:86: executing 'oc start-build --wait --follow busybox' expecting success and text 'hello world': the command returned the wrong error code; the output content test failed
Standard output from the command:
busybox-2

Standard error from the command:
error getting logs: pod "busybox-2-build" not found
error: The build cmd-builds/busybox-2 status is "Failed"

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_check/2558/console

@openshift-bot

Copy link
Copy Markdown
Contributor

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

The builds are actually failing to start because of missing registry:

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_check/2558/artifact/origin/artifacts/test-cmd/logs/openshift.log

I0628 04:48:13.067867   13869 factory.go:51] Giving up retrying Build cmd-builds/busybox-2: the image stream cmd-builds/busybox:latest cannot be used as the output for build cmd-builds/busybox-2 because the integrated Docker registry is not configured and no external registry was defined
E0628 04:48:13.067884   13869 factory.go:52] the image stream cmd-builds/busybox:latest cannot be used as the output for build cmd-builds/busybox-2 because the integrated Docker registry is not configured and no external registry was defined

@bparees

bparees commented Jun 28, 2016

Copy link
Copy Markdown
Contributor

@rhcarvalho yeah i'm pretty sure the merge queue is in a bad state right now. thought someone was working on it, but now i'm less convinced.

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

Doing tests locally, I changed test/cmd/build.sh to create a registry:

+ os::cmd::expect_success_and_text "oadm registry -n default" 'Creating registry registry'

Now I'm getting this in the server logs:

I0628 13:16:39.777745    1023 factory.go:478] Unable to schedule cmd-builds busybox-1-build: no nodes are registered to the cluster; waiting

@bparees do you know how I could make builds actually happen in test/cmd or are they disabled on purpose?

Seems that all other tests just start builds but don't really check if the builds started / finished.

@bparees

bparees commented Jun 28, 2016

Copy link
Copy Markdown
Contributor

@bparees do you know how I could make builds actually happen in test/cmd or are they disabled on purpose?
Seems that all other tests just start builds but don't really check if the builds started / finished.

@stevekuznetsov is probably the best person to answer that question.

@stevekuznetsov

Copy link
Copy Markdown
Contributor

test/cmd runs the API server/master but no node so there's nowhere to actually schedule the builder pods, etc

test/cmd tests should be simple integration tests for our API server

@stevekuznetsov

Copy link
Copy Markdown
Contributor

Tests trying to schedule builds, etc belong in test/extended

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

Yeah, so the future of the commented out tests with oc start-build is /dev/null, and we should have extended tests for the build post commit hook.

The hook adds nothing new to the CLI, so we can also get rid of the other commands that don't really test anything specific to hooks.

@bparees

bparees commented Jun 28, 2016

Copy link
Copy Markdown
Contributor

I thought we did have extended tests for post-commit hook. if we don't, then yeah, we need that.

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

I thought we did have extended tests for post-commit hook. if we don't, then yeah, we need that.

Back when it was added we went towards unit tests and test/cmd. #6715

Going to create extended tests and ditch this.

@rhcarvalho

Copy link
Copy Markdown
Contributor Author

@rhcarvalho rhcarvalho closed this Jul 11, 2016
@rhcarvalho
rhcarvalho deleted the start-build-expired-watcher branch July 11, 2016 13:37
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.

5 participants