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

No container teardown for isolated test #106

Closed
luckysori opened this issue Sep 12, 2019 · 3 comments
Closed

No container teardown for isolated test #106

luckysori opened this issue Sep 12, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@luckysori
Copy link

The expectation is that testcontainers should tear down a container after a test is completed, but when running the following test in isolation using cargo test <TESTNAME>

    #[test]
    fn test() {
        let docker = testcontainers::clients::Cli::default();
        docker.run(testcontainers::images::coblox_bitcoincore::BitcoinCore::default());
    }

the docker container remains up after the test has passed.

Interestingly, this doesn't happen if the test is run using cargo test.

@luckysori luckysori added the bug Something isn't working label Sep 12, 2019
bors bot added a commit that referenced this issue Sep 9, 2020
200: Fix `Cli::rm` not blocking until rm is successful r=thomaseizinger a=TheButlah

Fixes #199

Potentially fixes - #193, #106

Changed:
- `Cli::rm()` method now blocks until command finishes executing.

Added:
- Test case to ensure that `Cli::rm()` command actually fails instead of silently succeeding. 

Co-authored-by: Ryan Butler <thebutlah@gmail.com>
bors bot added a commit that referenced this issue Sep 14, 2020
200: Fix `Cli::rm` not blocking until rm is successful r=thomaseizinger a=TheButlah

Fixes #199

Potentially fixes - #193, #106

Changed:
- `Cli::rm()` method now blocks until command finishes executing.

Added:
- Test case to ensure that `Cli::rm()` command actually fails instead of silently succeeding. 

Co-authored-by: Ryan Butler <thebutlah@gmail.com>
@thomaseizinger
Copy link
Collaborator

Any chance you can try to reproduce the issue with latest dev @luckysori?

@luckysori
Copy link
Author

The original issue was about containers staying up when running tests independently, but I just ran cargo test on comit-network/thor after updating the testcontainers-rs dependency to dev and 5 containers have stayed up.

@luckysori
Copy link
Author

luckysori commented Sep 15, 2020

The original issue was about containers staying up when running tests independently, but I just ran cargo test on comit-network/thor after updating the testcontainers-rs dependency to dev and 5 containers have stayed up.

Actually, I think the reason this happened was unrelated to testcontainers-rs! Having tried it some more, it seems like containers are being torn down correctly. I am happy to close this issue and report back if I notice anything like this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants