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

[Libbeat] Flaky TestWatcherDie test #7906

Closed
ruflin opened this issue Aug 8, 2018 · 5 comments · Fixed by #21851
Closed

[Libbeat] Flaky TestWatcherDie test #7906

ruflin opened this issue Aug 8, 2018 · 5 comments · Fixed by #21851
Assignees
Labels
flaky-test Unstable or unreliable test cases. libbeat Team:Integrations Label for the Integrations team

Comments

@ruflin
Copy link
Member

ruflin commented Aug 8, 2018

Link: https://beats-ci.elastic.co/job/elastic+beats+master+multijob-windows/beat=libbeat,label=windows/1331/console
Platform: Windows

Error

>> go test: Unit Testing
11:34:30 FAILURES:
11:34:30 Error: go test failed: 1 test failures
11:34:30 Package: github.com/elastic/beats/libbeat/common/docker
11:34:30 Test:    TestWatcherDie
11:34:30 assertions.go:247: 
11:34:30                           
11:34:30 	Error Trace:	watcher_test.go:385
11:34:30 	
11:34:30 	Error:      	Not equal: 
11:34:30 	
11:34:30 	            	expected: 1
11:34:30 	
11:34:30 	            	actual  : 0
11:34:31 	
11:34:31 	Test:       	TestWatcherDie
11:34:31 assertions.go:247: 
11:34:31                           
11:34:31 	Error Trace:	watcher_test.go:385
11:34:31 	
11:34:31 	Error:      	Not equal: 
11:34:31 	
11:34:31 	            	expected: 1
11:34:31 	
11:34:31 	            	actual  : 0
11:34:31 	
11:34:31 	Test:       	TestWatcherDie
11:34:31 assertions.go:247: 
11:34:31                           
11:34:31 	Error Trace:	watcher_test.go:385
11:34:31 	
11:34:31 	Error:      	Not equal: 
11:34:31 	
11:34:31 	            	expected: 1
11:34:31 	
11:34:31 	            	actual  : 0
11:34:31 	
11:34:31 	Test:       	TestWatcherDie
11:34:31 assertions.go:247: 
11:34:31                           
11:34:31 	Error Trace:	watcher_test.go:385
11:34:31 	
11:34:31 	Error:      	Not equal: 
11:34:31 	
11:34:31 	            	expected: 1
11:34:31 	
11:34:31 	            	actual  : 0
11:34:31 	
11:34:31 	Test:       	TestWatcherDie
11:34:31 ----
11:34:31 SUMMARY:
11:34:31   Fail:     1
11:34:31   Skip:     6
11:34:31   Pass:     788
11:34:31   Packages: 70
11:34:31   Duration: 33.5826022s
@ruflin ruflin added libbeat flaky-test Unstable or unreliable test cases. labels Aug 8, 2018
@ph
Copy link
Contributor

ph commented Sep 4, 2018

Adding more details here, This really look like a timing issues in the test suite.
I am not too familiar with the code there yet, but I see that we are using a mock, so I suspect we could instead use channel to manage the suite test flow.

	// Check it doesn't get removed while we request meta for the container
	for i := 0; i < 18; i++ {
		watcher.Container("0332dbd79e20")
		assert.Equal(t, 1, len(watcher.Containers()))
		time.Sleep(50 * time.Millisecond)
	}

	// Checks a max of 10s for the watcher containers to be updated
	for i := 0; i < 100; i++ {
		// Now it should get removed
		time.Sleep(100 * time.Millisecond)

		if len(watcher.Containers()) == 0 {
			break
		}
	}

@ruflin ruflin assigned jsoriano and unassigned ruflin Feb 15, 2019
@urso urso added the Team:Integrations Label for the Integrations team label Jan 3, 2020
@urso
Copy link

urso commented Jan 3, 2020

@jsoriano Test still fails quite often. The PR seems to be stalled for quite some time.

@andresrc
Copy link
Contributor

andresrc commented Jan 7, 2020

Let's see whether this still applies or we should close it

@jsoriano
Copy link
Member

jsoriano commented Jan 9, 2020

I will take another look, maybe we can refactor the docker watcher to reuse common.Cache instead of having their own cache with cleanup logic.

@jsoriano
Copy link
Member

I am going to skip these tests by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Unstable or unreliable test cases. libbeat Team:Integrations Label for the Integrations team
Projects
None yet
5 participants