question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow container reuse opt-in via API

See original GitHub issue

Hello all,

I’ve enabled support for container reuse in Quarkus dev-services in Quarkus:

It’s working great, many thanks for the nice improvement; althought so far I’ve only enabled it for selected containers, specifically the ones running relational databases people use for testing.

I’m aware - and have documented - that people need to enable this opt-in by setting the relevant property in the .testcontainers.properties configuration file.

This seems like a wise choice since the feature is currently experimental; yet people in our community have been asking to have this working by default on selected, cherry-picked containers, so it would be nice for us to have a way to opt-in for a particular container without people needing to edit the core configuration file.

I understand it’s possibly not a good time to do so, but eventually as the feature is considered more mature I’d love to see a way for the API to give a stronger hint to the Testcontainer core that a particular container really should be reused.

Proposal

One approach could be for the withReuse method to accept a three-state enum rather than a boolean, like { OFF|ON|According_to_config }.

Additional consequences

The logic to stop containers in Quarkus also needs to know if the container is allowed to be reused. So I suspect some other methods will need to be adapted to support this as wel, such as isShouldBeReused and possibly others.

Many thanks for the consideration! Reported on suggestion from cc/ @kiview at Devoxx 😃

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Sannecommented, May 24, 2022

Fair enough, thanks for all explanations!

I’ll close this now, hopefully a better proposal will emerge in time 😃

0reactions
ailjushkincommented, Oct 12, 2022

Hey guys, If I understood correctly, this feature is not unstable already and can be marked as official behaviour.

So I’d remove unstable API in code and added extended javadoc for this, and a paragraph in the docs, that in this way we are trying to make the settings of the re-use of containers explicit to users from the outside.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for AWS Lambda Container Reuse - Medium
Is leveraging container reuse in AWS Lambda to persist the connection and reduce lambda running time the right move for your project?
Read more >
Web API implementation - Best practices for cloud applications
Learn about best practices for implementing a web API and publishing it to make it available to client applications.
Read more >
Developing inside a Container - Visual Studio Code
Once the WSL 2 engine is enabled, you can either: Use the Dev Containers: Reopen in Container command from a folder already opened...
Read more >
Networking in Compose - Docker Documentation
A container is created using db 's configuration. It joins the network myapp_default under the name db . In v2.1+, overlay networks are...
Read more >
Custom Resources - Kubernetes
Custom resources A resource is an endpoint in the Kubernetes API that ... Multi-versioning, Allows serving the same object through two API ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found