Skip to content

Conversation

pstibrany
Copy link
Contributor

@pstibrany pstibrany commented Oct 31, 2019

Test failure reported by @gouthamve, after recent merge of PR #1756:

--- FAIL: TestWatchPrefix (3.86s)
    --- FAIL: TestWatchPrefix/etcd (1.86s)
        kv_test.go:191: key test/97 has incorrect value 0
        kv_test.go:191: key test/98 has incorrect value 0
        kv_test.go:191: key test/99 has incorrect value 0

Test was too strict. Now it checks that we receive most notifications, but not necessarily all.

Test watches for changes under prefix "test/" and expect single change in every key between 0-100.
It failed because it didn't wait long enough. Now it waits for longer time, but stops as soon it receives all notifications. Also watching for changes starts before generator starts, so that first changes can't possibly be missed.

Make sure we get most notifications, but not necessarily all.

Signed-off-by: Peter Štibraný <[email protected]>
Timeout for entire test is now longer, but we end early if there is
no value for 500ms. We again check that all keys were received exactly
once, no room for exceptions.

Signed-off-by: Peter Štibraný <[email protected]>
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pstibrany to patiently address my feedback. LGTM!

@pstibrany
Copy link
Contributor Author

pstibrany commented Oct 31, 2019

Thanks @pstibrany to patiently address my feedback. LGTM!

Thanks @pracucci for your review and feedback!

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gouthamve gouthamve merged commit 491b9de into cortexproject:master Nov 4, 2019
@pstibrany pstibrany deleted the flaky_test_fix branch November 4, 2019 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants