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

Wait for the host agent process to start in host agent integration tests #441

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

anusha94
Copy link
Contributor

Since we are running the host agent in the containers for integration
tests, the process is not started instantly sometimes and this causes
flakes in the tests. Adding a check to ensure the host agent process is
started and only then proceed with the tests

Signed-off-by: Nilanjan Daw [email protected]

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #438

Since we are running the host agent in the containers for integration
tests, the process is not started instantly sometimes and this causes
flakes in the tests. Adding a check to ensure the host agent process is
started and only then proceed with the tests

Signed-off-by: Nilanjan Daw <[email protected]>
agent/host_agent_test.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #441 (bcea510) into main (3e0b04f) will increase coverage by 0.42%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #441      +/-   ##
==========================================
+ Coverage   67.97%   68.40%   +0.42%     
==========================================
  Files          23       23              
  Lines        1705     1728      +23     
==========================================
+ Hits         1159     1182      +23     
  Misses        474      474              
  Partials       72       72              
Impacted Files Coverage Δ
agent/version/version.go 100.00% <0.00%> (ø)
agent/installer/registry.go 100.00% <0.00%> (ø)
agent/cloudinit/cloudinit.go 76.66% <0.00%> (ø)
agent/cloudinit/cmd_runner.go 100.00% <0.00%> (ø)
agent/cloudinit/file_writer.go 29.23% <0.00%> (ø)
agent/cloudinit/template_parser.go 50.00% <0.00%> (ø)
agent/reconciler/host_reconciler.go 79.23% <0.00%> (ø)
agent/installer/internal/algo/apt_step.go 100.00% <0.00%> (ø)
agent/installer/internal/algo/installer.go 86.15% <0.00%> (ø)
apis/infrastructure/v1beta1/byohost_webhook.go 87.50% <0.00%> (ø)
... and 8 more

Copy link
Contributor

@dharmjit dharmjit left a comment

Choose a reason for hiding this comment

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

lgtm

@anusha94 anusha94 requested a review from pshail March 23, 2022 05:55
@jamiemonserrate
Copy link
Contributor

I think this makes sense, and is a good incremental step to improving the flakiness. I am slightly worried that this check might pass wrongly if there is any process that matches the name agent. But this is a good start.

But is this enough? That is, should we be checking if the host-agent has reached a desired state? Like maybe the log messages should say "agent started/ready" or something?

Just a suggestion, as I'm not sure what exactly we need to wait for.

@anusha94
Copy link
Contributor Author

But is this enough? That is, should we be checking if the host-agent has reached a desired state? Like maybe the log messages should say "agent started/ready" or something?

Good suggestion, if the flakiness persists, we could try that.

@anusha94 anusha94 merged commit d7670d6 into vmware-tanzu:main Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky Host Agent Integration tests
5 participants