Skip to content

informer test: reduce flakyness by waiting for correct state#587

Merged
cben merged 1 commit intoManageIQ:masterfrom
grosser:grosser/testf
Dec 20, 2022
Merged

informer test: reduce flakyness by waiting for correct state#587
cben merged 1 commit intoManageIQ:masterfrom
grosser:grosser/testf

Conversation

@grosser
Copy link
Copy Markdown
Contributor

@grosser grosser commented Nov 27, 2022

hopefully improving on #586 (comment)
before we waited a set amount of time and now we wait until the watcher is ready
... which will stop and fail in that spot if it never got ready


def watch_to_update_cache
watcher = @client.watch_entities(@resource_name, watch: true, resource_version: @started)
@watcher = @client.watch_entities(@resource_name, watch: true, resource_version: @started)
Copy link
Copy Markdown
Collaborator

@cben cben Nov 28, 2022

Choose a reason for hiding this comment

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

Is it worth adding @watcher = nil in #initialize ? It'd be purely cosmetic, to "announce" to reader what attrs will be used. However being internal to this method, maybe actually this one is not interesting to "announce"? 🤷 Fine either way.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Similar question for @worker which is shared across 2 methods, so there I'd say worth "announcing".

@cben
Copy link
Copy Markdown
Collaborator

cben commented Dec 20, 2022

just for the record, this still had a CI failure https://github.com/ManageIQ/kubeclient/actions/runs/3560257866/jobs/5980172236#step:6:224

RetryTest#test_timeout [/Users/runner/work/kubeclient/kubeclient/test/test_informer.rb:135]:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, invoked never: #<AnyInstance:Kubeclient::Common::WatchStream>.finish(any_parameters)
satisfied expectations:
- expected never, invoked never: #<Logger:0x12188>.error()

@cben
Copy link
Copy Markdown
Collaborator

cben commented Dec 20, 2022

@grosser whenever I "Re-run all jobs", I'm getting 1–2 failures...
Anyway this makes the test more deterministic, so I'm merging.

@cben cben merged commit 0e98b30 into ManageIQ:master Dec 20, 2022
@grosser grosser deleted the grosser/testf branch December 22, 2022 03:40
@grosser
Copy link
Copy Markdown
Contributor Author

grosser commented Dec 22, 2022

maybe this helps #593

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.

2 participants