Skip to content

.wait_for() log after container started #840

@amab8901

Description

@amab8901

Use case:

I disconnect container A (after both containers A and B were started) to see whether container B responds with expected error log, and I make assertion for it.

Current workaround

I use sleep to wait a fixed amount of time after which I expect the error log to be printed, and then the assertion gets run

Flaws with the workaround

  • If I run more integration tests simultaneously or run the integration tests on slower platform (lower-spec computer, CI), the amount of time sleeped might be insufficient for the error log to appear, which would fail the assertion. I'd have to revisit old integration tests and increase the sleep time
  • if I run the integration test on faster platform (high-end computer), or run it in isolation (instead of all integration tests simultaneously) the integration tests will take longer time than necessary to complete
  • Even if I can eventually find the right amount of time to sleep, it still takes a lot of tinkering and many runs to figure out what's the right amount of time to sleep.

Solution

Would be nice to have a method like .with_wait_for() but after the container has started. Implemented on ContainerAsync<I: Image>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions