Skip to content

CDRIVER-4134 Use simple HTTP server for /http tests #1237

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

Merged
merged 7 commits into from
Apr 14, 2023

Conversation

eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Apr 14, 2023

Description

Followup to #1179. Partially Resolves CDRIVER-4134. Verified by this patch.

Due to continued failure of the /http tests, this PR replaces use of httpbin.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 a python3 binary when simple_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 in run-tests.sh was refactored into a more general wait_for_server to accomodate both the simple HTTP server and the mock KMS servers.

@eramongodb eramongodb requested a review from kevinAlbs April 14, 2023 19:57
@eramongodb eramongodb self-assigned this Apr 14, 2023
@eramongodb
Copy link
Contributor Author

Resolved the task failures on rhel70 and windows-64-vs2017 distros by using find_python3 via a new PYTHON3_BINARY EVG expansion defined by fetch-det. Verified by this patch.

Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Thank you for the fix. The addition of PYTHON3_BINARY seems useful.

@eramongodb eramongodb merged commit 510c1c3 into mongodb:master Apr 14, 2023
@eramongodb eramongodb deleted the cdriver-4134 branch April 14, 2023 21:44
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.

2 participants