Skip to content
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

Gunicorn container halts test session #362

Closed
c0c0n3 opened this issue Sep 14, 2020 · 3 comments
Closed

Gunicorn container halts test session #362

c0c0n3 opened this issue Sep 14, 2020 · 3 comments
Assignees

Comments

@c0c0n3
Copy link
Member

c0c0n3 commented Sep 14, 2020

Describe the bug

During the test session in the Travis build, it looks like the Gunicorn server in the Docker container suddenly comes to the foreground, so tests stop, and eventually Travis kills the build.

To Reproduce

Do a clean check out of the master branch, fully prune your Docker system taking care of not leaving behind any dangling images/containers, remove all your Python venvs, clean up any Python env vars, then in a fresh terminal:

$ cd where/you/cloned/ngsi-timeseries-api
$ pipenv install
$ source setup_dev_env.sh
$ sh run_tests.sh 

At some point during the test session you should see the Gunicorn container coming to the foreground and making the tests hang.

Expected behavior

Gunicorn container should sit in the background, allowing pytest to go on with the test session.

Additional context

See any of the following build logs:

@c0c0n3 c0c0n3 self-assigned this Sep 14, 2020
@c0c0n3 c0c0n3 mentioned this issue Sep 14, 2020
@c0c0n3 c0c0n3 changed the title Gunicorn container weirdness Gunicorn container halts test session Sep 16, 2020
@chicco785
Copy link
Contributor

the problem is not gunicorn, but the new image using entrypoint instead of command, which makes the integration tests fail in the content load fase

chicco785 added a commit that referenced this issue Sep 19, 2020
* added code to group entities by servicepath when multiple notifications arrive at once (#208)
* add tests and integration tests (so we have also test with orion triggering such case)
* fix notification tests to rely only on api calls (remove call to translator)
* changed error code to 400 when due to invalid request
* upgraded python to 3.8.5
* fix integration test to use new docker image with entrypoint (#362)
@chicco785 chicco785 mentioned this issue Sep 19, 2020
@c0c0n3
Copy link
Member Author

c0c0n3 commented Sep 21, 2020

ah, thanks for that. I wonder why tests were passing for a while even on Travis as well as on our boxes. Anyhoo, let's fix forward.

c0c0n3 pushed a commit that referenced this issue Sep 22, 2020
* fix #208

* added code to group entities by servicepath when multiple notifications arrive at once (#208)
* add tests and integration tests (so we have also test with orion triggering such case)
* fix notification tests to rely only on api calls (remove call to translator)
* changed error code to 400 when due to invalid request
* upgraded python to 3.8.5
* fix integration test to use new docker image with entrypoint (#362)

* minor fixes

* remove build (we can assume a build is available)
* remove volumes at the end of the test
* increase timesleep for one test
* improve code

* minor fixes

* fix timeing for notifications
* fix error message check

* add back docker build
@c0c0n3
Copy link
Member Author

c0c0n3 commented Sep 22, 2020

fixed by #363

@c0c0n3 c0c0n3 closed this as completed Sep 22, 2020
chicco785 added a commit that referenced this issue Sep 22, 2020
* added code to group entities by servicepath when multiple notifications arrive at once (#208)
* add tests and integration tests (so we have also test with orion triggering such case)
* fix notification tests to rely only on api calls (remove call to translator)
* changed error code to 400 when due to invalid request
* upgraded python to 3.8.5
* fix integration test to use new docker image with entrypoint (#362)
c0c0n3 added a commit that referenced this issue Sep 25, 2020
* fix #208

* added code to group entities by servicepath when multiple notifications arrive at once (#208)
* add tests and integration tests (so we have also test with orion triggering such case)
* fix notification tests to rely only on api calls (remove call to translator)
* changed error code to 400 when due to invalid request
* upgraded python to 3.8.5
* fix integration test to use new docker image with entrypoint (#362)

* minor fixes

* remove build (we can assume a build is available)
* remove volumes at the end of the test
* increase timesleep for one test
* improve code

* fix #347

* fix wrong delete logic not keeping into account correctly servicePath!=None
* add test for #347 bug
 * add test for selective service path delete

* add drop all also to single entity delete if table is empty

* fix tests to correctly delete entities with service paths

* dont drop table when deleting entities, use a separate endpoint for that.

* factor out common http code from delete module.

* make delete api work w/ any translator.

* keep timescale version in env var as done for other services.

* temp solution to automate delete tests for timescale, ditch when timescale support is complete.

* use droptable query param to drop entity table instead of separate endpoint.

Co-authored-by: c0c0n3 <andrea.falconi@gmail.com>
c0c0n3 added a commit that referenced this issue Sep 25, 2020
* fix #208

* added code to group entities by servicepath when multiple notifications arrive at once (#208)
* add tests and integration tests (so we have also test with orion triggering such case)
* fix notification tests to rely only on api calls (remove call to translator)
* changed error code to 400 when due to invalid request
* upgraded python to 3.8.5
* fix integration test to use new docker image with entrypoint (#362)

* minor fixes

* remove build (we can assume a build is available)
* remove volumes at the end of the test
* increase timesleep for one test
* improve code

* minor fixes

* fix timeing for notifications
* fix error message check

* add tests to produce a similar case as #353

* use only from
* use from in combination with last

* put building of docker image back in load test.

* fix backward compat test.

Co-authored-by: c0c0n3 <andrea.falconi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants