Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate tests with external server dependencies #3624

Open
liggitt opened this issue Jul 8, 2015 · 11 comments
Open

Isolate tests with external server dependencies #3624

liggitt opened this issue Jul 8, 2015 · 11 comments
Labels
area/tests component/internal-tools kind/test-flake Categorizes issue or PR as related to test flakes. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/P2

Comments

@liggitt
Copy link
Contributor

liggitt commented Jul 8, 2015

Several tests at several layers (unit, integration, test-cmd.sh, etc) have dependencies on external servers like dockerhub, etc. When these servers have issues, they can block the merge queue.

Possible failures (all from #3619):

--- FAIL: TestImage (0.91s)
    client_test.go:105: unexpected error: error getting X-Docker-Token from openshift/origin-not-found: Get http://index.docker.io/v1/repositories/openshift/origin-not-found/images/: EOF
error: no image or template matched "mysql"
!!! Error in hack/test-cmd.sh:501
  '[ "$(oc new-app mysql --name=db | grep db)" ]' exited with status 1
Call stack:
  1: hack/test-cmd.sh:501 main(...)
Exiting with status 1
--- FAIL: TestRunAll (2.03s)
    newapp_test.go:686: emptyDir volumes: Error mismatch! Expected <nil>, got no image or template matched "mysql": the image "ee2cb077006e3385648619d6adf66d5ac53cfb11c4b2708636c5be0a12b23ff7" in repository "library/mysql" was not found and may have been deleted

Our core tests should be able to run with minimal dependencies on external servers. Tests that depend on other servers should be moved to an extended test suite.

@soltysh
Copy link
Member

soltysh commented Jul 8, 2015

Totally agree, unit tests should use mock in those areas, since we want to keep test coverage high with basic unit tests. I just run into:

--- FAIL: TestRunBuild (1.02s)
    newapp_test.go:835: successful ruby app generation: Error mismatch! Expected <nil>, got no image or template matched "openshift/ruby-20-centos7": the image "d5de68d8a25674ccfedfb7415b214f73c0de526d15ab08a5b4d43c1e5e96a1cd" in repository "openshift/ruby-20-centos7" was not found and may have been deleted

Generally speaking we should replace external deps with pre-built stuff available in testing env (eg. docker images, github repos, etc.)

@stevekuznetsov
Copy link
Contributor

I just ran into the following errors:
Timeout panics here:

panic: test timed out after 1m0s
goroutine 52 [running]:
testing.func·008()
    /usr/local/go/src/testing/testing.go:681 +0x168
created by time.goFunc
    /usr/local/go/src/time/sleep.go:129 +0x59
goroutine 1 [chan receive]:
testing.RunTests(0xbfb318, 0xf996a0, 0x8, 0x8, 0xc208095b01)
    /usr/local/go/src/testing/testing.go:556 +0xdc3
testing.(*M).Run(0xc20809b2c0, 0x19405e0)
    /usr/local/go/src/testing/testing.go:485 +0xe1
main.main()
    github.com/openshift/origin/pkg/dockerregistry/_test/_testmain.go:112 +0x382

Git error in asset tests:

Running "cdnify:dist" (cdnify) task
Going through dist/404.html, dist/index.html to update script refs
Warning: Failed to execute "git ls-remote --tags --heads git://github.com/jquery/jquery.git", exit code of #128 Use --force to continue.
Aborted due to warnings.

@liggitt
Copy link
Contributor Author

liggitt commented Aug 11, 2015

we can remove the cdnify task

@smarterclayton
Copy link
Contributor

    /data/src/github.com/openshift/origin/_output/local/go/src/github.com/openshift/origin/pkg/generate/app/cmd/newapp_test.go:1223 +0xc45
testing.tRunner(0xc20802db00, 0x1e4f8d8)
    /usr/lib/golang/src/testing/testing.go:447 +0x134
created by testing.RunTests
    /usr/lib/golang/src/testing/testing.go:555 +0xd4e
FAIL    github.com/openshift/origin/pkg/generate/app/cmd    60.061s

@smarterclayton smarterclayton added the kind/test-flake Categorizes issue or PR as related to test flakes. label Oct 28, 2015
@deads2k
Copy link
Contributor

deads2k commented Jan 12, 2016

@liggitt are you making progress on this? Doesn't really look like it.

Why not squash individual ones as they come up?

@liggitt
Copy link
Contributor Author

liggitt commented Jan 12, 2016

I am not. dockerhub and github are our biggest dependencies, and they are pervasive.

@smarterclayton
Copy link
Contributor

We've moved some to integration. For now, this is unactionable.

@liggitt
Copy link
Contributor Author

liggitt commented Mar 23, 2017

this is biting us for maintenance releases with dependencies on dockerhub versions that don't exist any more

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 9, 2018
@soltysh
Copy link
Member

soltysh commented Feb 13, 2018

/remove-lifecycle stale
/lifecycle frozen

@openshift-ci-robot openshift-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 13, 2018
@liggitt
Copy link
Contributor Author

liggitt commented Aug 30, 2018

/unassign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests component/internal-tools kind/test-flake Categorizes issue or PR as related to test flakes. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/P2
Projects
None yet
Development

No branches or pull requests

9 participants