svanoort / pyresttest

Python Rest Testing
Apache License 2.0
1.15k stars 326 forks source link

Problems with Python app using uwsgi inside a docker container #301

Open ribx opened 5 years ago

ribx commented 5 years ago

I am running my python application inside a docker container and wanted to run some automatic testing.

When I use --interactive true and wait a second between the calls, everything runs fine, but otherwise I get the following error:

* We are completely uploaded and fine
* Connection died, retrying a fresh connect
* necessary data rewind wasn't possible
* Closing connection 5
ERROR:Test Failed: Testseries object PUT (change object) URL=http://127.0.0.1:3000/api/v1/endpoint Group=Default HTTP Status Code: None
ERROR:Test Failure, failure type: Curl Exception, Reason: Curl Exception: (65, "necessary data rewind wasn't possible")
ERROR:Validator/Error details:Traceback (most recent call last):
  File "~/.virtualenvs/project/lib/python3.5/site-packages/pyresttest/resttest.py", line 351, in run_test
    curl.perform()  # Run the actual call
pycurl.error: (65, "necessary data rewind wasn't possible")

I am running 90 tests and it is not deteministic, which one will fail with this error message.

Using my javascript frontend I never experience such a problem. The software is running for over one year in production.

I guess this is somehow connected to the docker proxy?

ribx commented 5 years ago

I tried to use the host network to avoid having to go through the docker proxy. It looks like it's uwsgi's fault.

ribx commented 5 years ago

I had success adding

  - curl_option_fresh_connect: True