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

vdk-trino: stabilize vdk-trino tests #1677

Merged
merged 1 commit into from
Mar 1, 2023
Merged

Conversation

antoniivanov
Copy link
Collaborator

@antoniivanov antoniivanov commented Feb 27, 2023

This change is fixing vdk-trino tests which are failing regularly in the nightly builds . See
#1559

The tests were failing intermittently for two main reasons

  • Docker failures which are being fixed by adopting testcontainers (in favour of pytest-docker)
  • Hidden dependencies between test cases (because different test use same schema and tables on shared db instance)

Until now we used pytest-docker to start service container, this is switching it to testcontainers-python.

There are multiple advantages of using it.

  • Supposedly Testcontainers is built with performance in mind and uses a variety of techniques to minimize container startup time and resource usage like image reuse, container reuse, asynchronous operations.
  • It is far more popular lately - https://hugovk.github.io/top-pypi-packages/ is a site I frequently use to decide which library is likely to be more stable/used . It is showing testcontainers is 2000 places ahead of pytest-docker
  • Testcontainers provides a wider range of features for managing containers, such as starting and stopping them, waiting for them to become available, and exposing their ports to the host system
  • Testcontainers-Python allows you to define and configure containers using Python code instead of yaml which pytest-docker required.

Testing Done: ran the test suite of vdk-trino a few times and it was more stable and quick. I have not run actual benchmarks and recorded times but it seems about twice faster possibly. We will verify this as part of the nightly builds.

@antoniivanov antoniivanov force-pushed the person/aivanov/vdk-trino branch 4 times, most recently from c8401e0 to 3899dc0 Compare February 28, 2023 08:58
Copy link
Contributor

@ivakoleva ivakoleva left a comment

Choose a reason for hiding this comment

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

LGTM
(mind the codacy report)

projects/vdk-plugins/vdk-trino/tests/conftest.py Outdated Show resolved Hide resolved
projects/vdk-plugins/vdk-trino/tests/conftest.py Outdated Show resolved Hide resolved
projects/vdk-plugins/vdk-trino/tests/conftest.py Outdated Show resolved Hide resolved
projects/vdk-plugins/vdk-trino/tests/conftest.py Outdated Show resolved Hide resolved
projects/vdk-plugins/vdk-trino/tests/conftest.py Outdated Show resolved Hide resolved
@antoniivanov antoniivanov force-pushed the person/aivanov/vdk-trino branch 6 times, most recently from 1dd2018 to d9fc846 Compare March 1, 2023 10:11
@antoniivanov antoniivanov changed the title vdk-trino: change test container library vdk-trino: stabilize vdk-trino tests Mar 1, 2023
This change is part of fixing vdk-trino which is failing regularly in
the nightly builds . See
#1559

Until now we used pytest-docker to start service container, this is
switching it to testcontainers-python.

There are multiple advanrages of using it.

* Supposedly Testcontainers is built with performance in mind and uses a
variety of techniques to minimize container startup time and resource
usage like image reuse, container reuse, asynchronous operations.

* It is far more popular lately -
https://hugovk.github.io/top-pypi-packages/  is a site I frequently used
to decide which library is likely to be more stable/used . It is showing
testcontainers is 2000 places ahead of pytest-docker

* Testcontainers provides a wider range of features for managing
containers, such as starting and stopping them, waiting for them to
become available, and exposing their ports to the host system

* Testcontainers-Python allows you to define and configure containers
using Python code instaed of yaml which pytest-docker required.

Testing Done: ran the test suite of vdk-trino a few times and it was
more stable and quick. I have not run actual benchmarks and recorded
times but it seems abotu twice faster possibly. We will verify this as
part of the nightly builds.

Signed-off-by: Antoni Ivanov <aivanov@vmware.com>

vdk-trino: debugging commit

Signed-off-by: Antoni Ivanov <aivanov@vmware.com>
@antoniivanov antoniivanov enabled auto-merge (squash) March 1, 2023 14:20
@antoniivanov antoniivanov merged commit aace6b7 into main Mar 1, 2023
@antoniivanov antoniivanov deleted the person/aivanov/vdk-trino branch March 1, 2023 14:29
yonitoo pushed a commit that referenced this pull request Mar 1, 2023
This change is fixing vdk-trino tests which are failing regularly in the
nightly builds . See
#1559

The tests were failing intermittently for two main reasons 
* Docker failures which are being fixed by adopting testcontainers (in
favour of pytest-docker)
* Hidden dependencies between test cases (because different test use
same schema and tables on shared db instance)

Until now we used pytest-docker to start service container, this is
switching it to testcontainers-python.

There are multiple advantages of using it.

* Supposedly Testcontainers is built with performance in mind and uses a
variety of techniques to minimize container startup time and resource
usage like image reuse, container reuse, asynchronous operations.
* It is far more popular lately -
https://hugovk.github.io/top-pypi-packages/ is a site I frequently use
to decide which library is likely to be more stable/used . It is showing
testcontainers is 2000 places ahead of pytest-docker
* Testcontainers provides a wider range of features for managing
containers, such as starting and stopping them, waiting for them to
become available, and exposing their ports to the host system
* Testcontainers-Python allows you to define and configure containers
using Python code instead of yaml which pytest-docker required.

Testing Done: ran the test suite of vdk-trino a few times and it was
more stable and quick. I have not run actual benchmarks and recorded
times but it seems about twice faster possibly. We will verify this as
part of the nightly builds.

Signed-off-by: Antoni Ivanov <aivanov@vmware.com>
@antoniivanov antoniivanov restored the person/aivanov/vdk-trino branch March 1, 2023 19:16
@antoniivanov antoniivanov deleted the person/aivanov/vdk-trino branch July 28, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants