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

flaky test failure in RegistryDelete #3209

Closed
rade opened this issue Jun 4, 2018 · 5 comments · Fixed by #3688
Closed

flaky test failure in RegistryDelete #3209

rade opened this issue Jun 4, 2018 · 5 comments · Fixed by #3688
Labels
bug Broken end user or developer functionality; not working as the developers intended it component/build An issue concerning compilation, testing, packaging, distribution

Comments

@rade
Copy link
Member

rade commented Jun 4, 2018

I ran into this yesterday in a local build - re-running "fixed it" - and @bboreham encountered it in CI today

--- FAIL: TestRegistryDelete (0.01s)
	registry_test.go:511: Didn't get right container updates: 
		--- want
		+++ have
		@@ -1,4 +1,322 @@
		-([]report.Node) (len=1 cap=1) {
		+([]report.Node) (len=2 cap=2) {
                ...

Presumably a race condition in the test rather than a bug in the code.

@rade rade added bug Broken end user or developer functionality; not working as the developers intended it component/build An issue concerning compilation, testing, packaging, distribution labels Jun 4, 2018
@satyamz
Copy link
Contributor

satyamz commented Jun 11, 2018

I am also facing this issue on local make tests with -slow flag.

@bboreham
Copy link
Collaborator

Looks the same here: https://circleci.com/gh/weaveworks/scope/8977

I suspect the 100ms timeout.

@bboreham
Copy link
Collaborator

I suspect the 100ms timeout.

except I just raised it to 10 seconds and it still fails.

@bboreham
Copy link
Collaborator

The race is:

  • newMockClient() sets up a fake Docker with one container, container1.
  • TestRegistryDelete() calls testRegistry() calls NewRegistry() which starts a goroutine that calls listenForEvents()
  • TestRegistryDelete() calls registry.WatchContainerUpdates()
  • If listenForEvents() runs after registry.WatchContainerUpdates(), then the callback is fired with info about container1.
  • If listenForEvents() runs before registry.WatchContainerUpdates(), then the callback is not fired.

The test fails in the first case because it has two updates instead of the required one.

@bboreham bboreham changed the title spurious(?) test failure in RegistryDelete flaky test failure in RegistryDelete Aug 8, 2018
@bboreham
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken end user or developer functionality; not working as the developers intended it component/build An issue concerning compilation, testing, packaging, distribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants