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

Removing infinite download of extension manifest without a new GS #1874

Merged
merged 8 commits into from
May 22, 2020

Conversation

larohra
Copy link
Contributor

@larohra larohra commented Apr 29, 2020

Description

This PR contains the fix where we dont download the extension manifest without a new GoalSatate

Issue #


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and Travis.CI is passing.

Quality of Code and Contribution Guidelines

@larohra
Copy link
Contributor Author

larohra commented Apr 29, 2020

pgombar
pgombar previously approved these changes Apr 30, 2020
@@ -249,29 +249,6 @@ def test_extension_sequence_number(self):
disk_sequence_number=3,
expected_sequence_number=-1)

@patch("azurelinuxagent.ga.exthandlers.add_event")
@patch("azurelinuxagent.common.errorstate.ErrorState.is_triggered")
def test_it_should_report_an_error_if_the_wireserver_cannot_be_reached(self, patch_is_triggered, patch_add_event):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a redundant test, this scenario is being tested by the tests for try_update_goal_state functionality

@codecov
Copy link

codecov bot commented May 20, 2020

Codecov Report

Merging #1874 into develop will decrease coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1874      +/-   ##
===========================================
- Coverage    69.38%   69.24%   -0.15%     
===========================================
  Files           83       83              
  Lines        11499    11483      -16     
  Branches      1598     1597       -1     
===========================================
- Hits          7979     7951      -28     
- Misses        3183     3193      +10     
- Partials       337      339       +2     
Impacted Files Coverage Δ
azurelinuxagent/common/event.py 86.31% <ø> (-0.04%) ⬇️
azurelinuxagent/ga/exthandlers.py 86.16% <100.00%> (-1.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de81f1b...6eb6aa5. Read the comment docs.

@@ -1388,6 +1361,8 @@ def set_handler_status(self, status="NotReady", message="", code=0):
try:
handler_status_json = json.dumps(get_properties(handler_status))
if handler_status_json is not None:
if not os.path.exists(state_dir):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently if there is any exceptions in extension processing and the config directory doesnt exist, the error is never reported back to CRP and the customer has to wait for 90 mins before the operation timesout. This is a bad Customer Experience. To mitigate it, I'm creating the config directory incase it doesnt exist while reporting status.

exthandlers_handler.run()
_assert_mock_add_event_call(expected_call_count=1)
self._assert_handler_status(protocol.report_vm_status, "NotReady", 0, "1.0.0")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line will fail this test currently because the cleanup logic cleans up the state and we dont report it again. Once the PR #1889 is merged, this test should pass.

protocol.update_goal_state()

exthandlers_handler.run()
_assert_mock_add_event_call(expected_call_count=2)
Copy link
Member

Choose a reason for hiding this comment

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

checking for a fixed number of calls to add_event is fragile. If we happen to add an unrelated event on this path the test will break

Copy link
Member

@narrieta narrieta left a comment

Choose a reason for hiding this comment

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

minor comments

@larohra larohra merged commit e361a69 into Azure:develop May 22, 2020
@larohra larohra deleted the fix-infinite-manifest-check branch May 22, 2020 17:21
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.

3 participants