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 the status check of service in cluster #1166

Merged
merged 2 commits into from
Nov 27, 2021

Conversation

tianleh
Copy link
Member

@tianleh tianleh commented Nov 27, 2021

Signed-off-by: Tianle Huang tianleh@amazon.com

Description

fix the status check of service in cluster

Issues Resolved

Resolves #1165

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Tianle Huang <tianleh@amazon.com>
@tianleh tianleh requested a review from a team as a code owner November 27, 2021 09:28
@tianleh tianleh self-assigned this Nov 27, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2021

Codecov Report

Merging #1166 (0ee092d) into main (0cb2741) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #1166   +/-   ##
=========================================
  Coverage     93.75%   93.75%           
  Complexity       10       10           
=========================================
  Files           103      103           
  Lines          2563     2563           
  Branches          9        9           
=========================================
  Hits           2403     2403           
  Misses          150      150           
  Partials         10       10           
Impacted Files Coverage Δ
src/test_workflow/integ_test/service.py 94.33% <100.00%> (ø)

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 0cb2741...0ee092d. Read the comment docs.

Signed-off-by: Tianle Huang <tianleh@amazon.com>
@@ -68,7 +68,7 @@ def get_service_response(self):
def service_alive(self):
response = self.get_service_response()
logging.info(f"{response.status_code}: {response.text}")
if response.status_code == 200 and ('"status":"green"' or '"status":"yellow"' in response.text):
if response.status_code == 200 and (('"status":"green"' in response.text) or ('"status":"yellow"' in response.text)):
Copy link
Member

Choose a reason for hiding this comment

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

The service response is a JSON. To future proof this, there should be a class that wraps it, and exposes it’s properties, including an .alive method.

@dblock dblock merged commit d0c529c into opensearch-project:main Nov 27, 2021
@tianleh tianleh added the comment-to-followup Indicates a merged PR has remaining comments to follow up label Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-test-automation comment-to-followup Indicates a merged PR has remaining comments to follow up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: service status checks in integ test is wrong
4 participants