CDRIVER-4134 Use simple HTTP server for /http tests #1237
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Followup to #1179.
PartiallyResolves CDRIVER-4134. Verified by this patch.Due to continued failure of the
/http
tests, this PR replaces use ofhttpbin.org
with a simple Python HTTP server we run instead.Note: some tasks still fail on the rhel70 and windows-64-vs2017 distros, but deliberately deferring them to a followup PR to unblock most of the other tasks that currently fail that this PR addresses.Identified the issue being due to the absence of apython3
binary whensimple_http_server.py
is directly invoked.Simple HTTP Server
Uses the Python
http
package. It is a simple HTTP server that runs on port 8000 and sends a response to GET and POST requests. The port number can be changed to something else if 8000 (a very common default) conflicts with another process.config-generator Dependency
As a drive-by fix, observed a missing package error for
packaging
when running the config generator with Python 3.10, so added it to the requirements list.EVG Config
Added the
run_simple_http_server
component to the config generator.The
run-simple-http-server
EVG function is now invoked before all calls to the "run-tests" EVG function, excluding the DNS, CSE, and loadbalancer tasks which limit the tests executed (thus excluding the/http
tests).The simple HTTP server runs in the background in a manner similar to what is already being done for mock KMS servers. This is to avoid difficult "clean up background processes" logic in the
run-tests.sh
script which has been observed to lead to hanging tasks that timeout.The
wait_for_kms_server
Bash function inrun-tests.sh
was refactored into a more generalwait_for_server
to accomodate both the simple HTTP server and the mock KMS servers.