Skip to content

Docker for Mac 2.0.0.2: empty logs for short-lived containers #1205

Closed

Description

@rnorth

I've noticed an issue that I can reliably reproduce on Docker for Mac 2.0.0.2, but which does not appear on CI.

org.testcontainers.utility.DirectoryTarResourceTest#simpleRecursiveFileTest will fail ~80% of the time for me. This particular test uses a short-lived container comprising a cat CMD and with OneShotStartupCheckStrategy. The test attaches a ToStringConsumer to logs and waits for the end of stdout logs to be reached.

Some of the time, when the test passes, the log stream callback events are onStart, onNext (containing the desired stdout line) and onComplete.

After adding a little extra instrumentation, it appears that most of the time the log stream callback events are onStart, onComplete. onNext is never fired.

In this situation the test fails. However, when attempting to read the logs later, the correct log message is found.

My hypothesis is that this version of Docker automatically triggers the onComplete event at container exit even if there are unflushed stdout/stderr frames.

Activity

  1. self-assigned this
    on Feb 2, 2019
  2. added a commit that references this issue on Feb 2, 2019
    356b84a
  3. rnorth commented on Feb 9, 2019

    @rnorth
    MemberAuthor

    Bizarrely I don't get this issue on all of my Macs...

  4. added a commit that references this issue on Feb 15, 2019
    12da233
  5. added 2 commits that reference this issue on Mar 3, 2019
    ddcb7aa
    783aaeb
  6. added a commit that references this issue on Mar 24, 2019
    2c5f274
  7. added this to the 1.11.1 milestone on Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions