-
Notifications
You must be signed in to change notification settings - Fork 187
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
Fixed flaky CI tests by replacing httpbin with a simple http server #395
Fixed flaky CI tests by replacing httpbin with a simple http server #395
Conversation
Codecov Report
@@ Coverage Diff @@
## main #395 +/- ##
==========================================
+ Coverage 71.44% 71.57% +0.12%
==========================================
Files 77 77
Lines 7190 7190
==========================================
+ Hits 5137 5146 +9
+ Misses 2053 2044 -9
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's close! Let's cleanup the code, see below, and ensure we start/stop servers regardless of whether the tests pass/fail by moving setup/teardown in the right places.
test_opensearchpy/http_server.py
Outdated
self._server_thread = threading.Thread(target=self.serve_forever) | ||
self._server_thread.start() | ||
|
||
def stop(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates two shutdown()
methods, which is weird. Overwrite shutdown
or use an instance of HTTPServer
instead of overriding it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while overwriting shutdown I am getting "recursionerror: maximum recursion depth exceeded while calling a python object". So I left it as stop method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's close! Let's cleanup the code, see below, and ensure we start/stop servers regardless of whether the tests pass/fail by moving setup/teardown in the right places.
Signed-off-by: saimedhi <saimedhi@amazon.com>
6554a47
to
d68f37c
Compare
👏 |
Description
Fixed flaky CI tests by replacing httpbin with a simple http server
Issues Resolved
Closes #327
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.