-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix flakiness of engine tests #469
Comments
First one ( |
How about using this replace httpbin.org dependencies? Or maybe just keep it simple and use httptest package? |
@robingustafsson it seems everything from this issue has been taken care of except the TestEngineCollector test. I have encountered this issue yesterday and it seems the issue is in how the Collect function is implemented in the test Collector. There is a check for the running flag which is inconsistent with other Collector implementations since they don't do such a thing. I guess we have to sync up the test with actual Collector implementations in order to get this sorted out. I'm willing to do take care of this one once we agree on the solution here. |
Just making a note here that in #553 we discussed that the dummy collector has to be refactored, probably it should use a |
There are a couple of test cases for the engine that are flaky. We need to fix them as they generate a lot of false positive CI builds.
The test cases are:
TestEngineRun:collects samples
: this test has two wrong assumptions. The first is that thecutoff
in core/local/local.go will be set before thectx
is signalled Done resulting in the second sample to be appended to thesamples
slice in the mocked "RunOnce()" function (basically a race condition). The second is that<-ctx.Done()
will be selected beforecase samples := <-vuOut
in core/local/local.go:Run() which is not always the case (non-determinism ofselect
), and can cause all samples from the mocked "RunOnce()" function to be accepted. When either of these two happens there's a "wrong number of samples" error being generated.TestEngineCollector
: There seems to be a race condition here, the test sometimes errors out with a "panic: attempted to collect while not running" (from Dummy collector).Beyond these two, CircleCI builds also fail sometimes when running tests dependent on external sites like httpbin.org, see #464.
The text was updated successfully, but these errors were encountered: