This environment was created to reproduce and fix this bug.
There's 2 docker containers:
upload-server
- an instance of simple-upload-server for sending requests tourllib3-client
- urllib3 environment with slowed egress traffic for running urllib3 code
Requirements:
docker
docker-compose
- After cloning, initialise the environment with:
make init
- Start the environment with:
docker-compose up
- In a new shell on the host but it in the root of the repo, run the following to exec into the
urllib3-client
container:
docker-compose exec urllib3-client bash
- From the
urllib3-client
shell run the following script to trigger the bug:
python3 bug-bait.py
If the bug was successfully reproduced then a stacktrace containing the following error should be printed:
urllib3.exceptions.ProtocolError: ('Connection aborted.', TimeoutError('timed out'))
The following output will be immediately before the stack trace
Upload request finished in 5.401 seconds
Which is the timeout of the initial request + some overhead. If the timeout of the initial request is changed, the duration of the above output will change to track with it.
Run docker-compose down
to terminate the environment.