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

test: try to use testcontainers with reuse #19

Closed
wants to merge 1 commit into from

Conversation

tisonkun
Copy link
Owner

cargo x test

let postgres = Postgres.start().map_err(maybe_docker_error).unwrap();
let minio = MinIO.start().map_err(maybe_docker_error).unwrap();
let postgres = Postgres
.with_reuse(ReuseDirective::Always)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Failed with:

        FAIL [   4.602s] rskafka-tests::pubsub test_simple_pubsub

--- STDOUT:              rskafka-tests::pubsub test_simple_pubsub ---

running 1 test
test test_simple_pubsub ... FAILED

failures:

failures:
    test_simple_pubsub

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.59s


--- STDERR:              rskafka-tests::pubsub test_simple_pubsub ---
2024-12-21T19:24:03.605292+08:00[Asia/Shanghai]  WARN testcontainers::core::client: client.rs:463 Found 3 containers matching filters: {"label": ["org.testcontainers.managed-by=testcontainers"], "status": ["running"]}
thread 'test_simple_pubsub' panicked at tests/toolkit/src/container.rs:121:51:
called `Result::unwrap()` on an `Err` value: PortNotExposed { id: "6ea21e25e74ec833ee696efc2c421cb4d6c17576e270d01d3bfac7afd25ebdf2", port: Tcp(9000) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-12-21T19:24:03.889129+08:00[Asia/Shanghai] ERROR testcontainers::core::containers::sync_container: sync_container.rs:208 Failed to remove container on drop: failed to remove a container: Docker responded with status code 404: No such container: 6ea21e25e74ec833ee696efc2c421cb4d6c17576e270d01d3bfac7afd25ebdf2

   Canceling due to test failure: 2 tests still running
        FAIL [   4.729s] wal-tests::read_after_append test_simple_pubsub

--- STDOUT:              wal-tests::read_after_append test_simple_pubsub ---

running 1 test
test test_simple_pubsub ... FAILED

failures:

failures:
    test_simple_pubsub

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.72s


--- STDERR:              wal-tests::read_after_append test_simple_pubsub ---
2024-12-21T19:24:03.761151+08:00[Asia/Shanghai]  WARN testcontainers::core::client: client.rs:463 Found 3 containers matching filters: {"label": ["org.testcontainers.managed-by=testcontainers"], "status": ["running"]}
thread 'test_simple_pubsub' panicked at tests/toolkit/src/container.rs:121:51:
called `Result::unwrap()` on an `Err` value: PortNotExposed { id: "6ea21e25e74ec833ee696efc2c421cb4d6c17576e270d01d3bfac7afd25ebdf2", port: Tcp(9000) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-12-21T19:24:03.841380+08:00[Asia/Shanghai] ERROR testcontainers::core::containers::sync_container: sync_container.rs:208 Failed to remove container on drop: failed to remove a container: Docker responded with status code 409: removal of container 6ea21e25e74ec833ee696efc2c421cb4d6c17576e270d01d3bfac7afd25ebdf2 is already in progress

        FAIL [   4.761s] rdkafka-tests::pubsub test_simple_pubsub

--- STDOUT:              rdkafka-tests::pubsub test_simple_pubsub ---

running 1 test
test test_simple_pubsub ... FAILED

failures:

failures:
    test_simple_pubsub

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.75s


--- STDERR:              rdkafka-tests::pubsub test_simple_pubsub ---
2024-12-21T19:24:03.761261+08:00[Asia/Shanghai]  WARN testcontainers::core::client: client.rs:463 Found 3 containers matching filters: {"label": ["org.testcontainers.managed-by=testcontainers"], "status": ["running"]}
thread 'test_simple_pubsub' panicked at tests/toolkit/src/container.rs:121:51:
called `Result::unwrap()` on an `Err` value: PortNotExposed { id: "6ea21e25e74ec833ee696efc2c421cb4d6c17576e270d01d3bfac7afd25ebdf2", port: Tcp(9000) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-12-21T19:24:03.841307+08:00[Asia/Shanghai] ERROR testcontainers::core::containers::sync_container: sync_container.rs:208 Failed to remove container on drop: failed to remove a container: Docker responded with status code 409: removal of container 6ea21e25e74ec833ee696efc2c421cb4d6c17576e270d01d3bfac7afd25ebdf2 is already in progress

------------
     Summary [   4.765s] 10 tests run: 7 passed, 3 failed, 0 skipped
        FAIL [   4.761s] rdkafka-tests::pubsub test_simple_pubsub
        FAIL [   4.602s] rskafka-tests::pubsub test_simple_pubsub
        FAIL [   4.729s] wal-tests::read_after_append test_simple_pubsub
error: test run failed
thread 'main' panicked at xtask/src/main.rs:111:5:
command failed: exit status: 100
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

let postgres = Postgres.start().map_err(maybe_docker_error).unwrap();
let minio = MinIO.start().map_err(maybe_docker_error).unwrap();
let postgres = Postgres
.with_reuse(ReuseDirective::Always)
Copy link
Owner Author

Choose a reason for hiding this comment

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

If changed to CurrentSession, failed with:

        FAIL [   5.790s] rdkafka-tests::pubsub test_simple_pubsub

--- STDOUT:              rdkafka-tests::pubsub test_simple_pubsub ---

running 1 test
test test_simple_pubsub ... FAILED

failures:

failures:
    test_simple_pubsub

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.78s


--- STDERR:              rdkafka-tests::pubsub test_simple_pubsub ---
thread 'test_simple_pubsub' panicked at tests/toolkit/src/container.rs:121:51:
called `Result::unwrap()` on an `Err` value: PortNotExposed { id: "190491868a7916ad39ae60ed684ea7a93dcf427e4a7d2e03d6704457e041a0f6", port: Tcp(9000) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-12-21T19:25:13.985775+08:00[Asia/Shanghai] ERROR testcontainers::core::containers::sync_container: sync_container.rs:208 Failed to remove container on drop: failed to remove a container: Docker responded with status code 404: No such container: 190491868a7916ad39ae60ed684ea7a93dcf427e4a7d2e03d6704457e041a0f6

   Canceling due to test failure: 2 tests still running
        FAIL [   5.867s] rskafka-tests::pubsub test_simple_pubsub

--- STDOUT:              rskafka-tests::pubsub test_simple_pubsub ---

running 1 test
test test_simple_pubsub ... FAILED

failures:

failures:
    test_simple_pubsub

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.86s


--- STDERR:              rskafka-tests::pubsub test_simple_pubsub ---
thread 'test_simple_pubsub' panicked at tests/toolkit/src/container.rs:121:51:
called `Result::unwrap()` on an `Err` value: PortNotExposed { id: "4a03767cda73616bcc5d5bef4f3c5e4f1d1be6f501246cbf024a437f99f96a5e", port: Tcp(9000) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-12-21T19:25:14.104491+08:00[Asia/Shanghai] ERROR testcontainers::core::containers::sync_container: sync_container.rs:208 Failed to remove container on drop: failed to remove a container: Docker responded with status code 404: No such container: 4a03767cda73616bcc5d5bef4f3c5e4f1d1be6f501246cbf024a437f99f96a5e

        FAIL [   5.959s] wal-tests::read_after_append test_simple_pubsub

--- STDOUT:              wal-tests::read_after_append test_simple_pubsub ---

running 1 test
test test_simple_pubsub ... FAILED

failures:

failures:
    test_simple_pubsub

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.95s


--- STDERR:              wal-tests::read_after_append test_simple_pubsub ---
thread 'test_simple_pubsub' panicked at tests/toolkit/src/container.rs:121:51:
called `Result::unwrap()` on an `Err` value: PortNotExposed { id: "52f6b03631db71917ae4fb5732c7de1d8a138c31204e9762e6df20c1600e2442", port: Tcp(9000) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-12-21T19:25:14.181738+08:00[Asia/Shanghai] ERROR testcontainers::core::containers::sync_container: sync_container.rs:208 Failed to remove container on drop: failed to remove a container: Docker responded with status code 404: No such container: 52f6b03631db71917ae4fb5732c7de1d8a138c31204e9762e6df20c1600e2442

------------
     Summary [   5.963s] 10 tests run: 7 passed, 3 failed, 0 skipped
        FAIL [   5.790s] rdkafka-tests::pubsub test_simple_pubsub
        FAIL [   5.867s] rskafka-tests::pubsub test_simple_pubsub
        FAIL [   5.959s] wal-tests::read_after_append test_simple_pubsub
error: test run failed
thread 'main' panicked at xtask/src/main.rs:111:5:
command failed: exit status: 100
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@tisonkun tisonkun closed this Jan 20, 2025
@tisonkun tisonkun deleted the try-testconatiners-reuse branch January 20, 2025 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant