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

Fix Flaky test #1442

Closed
bwplotka opened this issue Aug 20, 2019 · 3 comments · Fixed by #1450
Closed

Fix Flaky test #1442

bwplotka opened this issue Aug 20, 2019 · 3 comments · Fixed by #1450

Comments

@bwplotka
Copy link
Member

reloader_test.go:269:

	exp: 5

	got: 3

--- FAIL: TestReloader_RuleApply (10.04s)
    reloader_test.go:238: Performing step number 1
    reloader_test.go:238: Performing step number 3
FAIL
FAIL	github.com/thanos-io/thanos/pkg/reloader	10.769s

Quite often spotted.

@johncming
Copy link
Contributor

reloads.Store(reloads.Load().(int) + 1) // The only writer.

Reason: plus op is not an atomic operation.

@jojohappy
Copy link
Member

jojohappy commented Aug 22, 2019

@bwplotka @johncming I guess that the reloader read the middle status of watched files, because of using ioutil.WriteFile.

// WriteFile writes data to a file named by filename.
// If the file does not exist, WriteFile creates it with permissions perm;
// otherwise WriteFile truncates it before writing.

Then trigger reload handler twice, the atomic would be added twice.

@bwplotka
Copy link
Member Author

bwplotka commented Aug 22, 2019

@johncming I think this part is ok as there is only a single writer.

@jojohappy you are right but this can happen normally as well so we should handle it properly.

IMO it is just a CI slowdown, so increasing timeout here #1442 (: EDIT: Actually here: #1450

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants