Skip to content

TestFlake: TestDaggerTerminal hangs #8554

Closed

Description

@sipsma

I've seen this one a handful of times in CI now, most recent occurrence a few commits ago on main:

The test case appears to be going as expected, the interactive container is opened after the failed exec, runs some commands, successfully sends exit and then the test hangs until the timeout on the whole suite of 30m is hit.

The next test case lines don't show up in progress output, so I'd guess it's hanging somewhere around this line: https://github.com/sipsma/dagger/blob/5e3299c08d62c3fc91d1ce02b79466ea20c02562/core/integration/module_terminal_test.go#L545-L545

No immediate strong clues, first hunch is to look for any race conditions in the debug container code that could result in a hang after an exit. Given the load the CI runners are under wouldn't be surprising if a rare race condition only gets triggered there.

  • Will start by re-opening my deflaking PR and keep re-running there til I hit it and then shell into the CI runner and getting a stack trace from the engine to see what line, if any, it's stuck on.

Activity

  1. added
    kind/bug
    on Sep 23, 2024
  2. sipsma commented on Oct 10, 2024

    @sipsma
    ContributorAuthor

    This one is still appearing (GHA) (Traces)

  3. added
    kind/flake
    on Oct 10, 2024
  4. sipsma commented on Nov 19, 2024

    @sipsma
    ContributorAuthor

    Another recent occurrence https://dagger.cloud/dagger/traces/15c22afdc0ae043aed5e80b9282135f8

    It seems like the on failure test in particular is prone to this (might be the only one?) cc @aluzzardi

  5. sipsma commented on Nov 20, 2024

    @sipsma
    ContributorAuthor

    While working on the filesync stuff I started hitting this flake locally relatively consistently by running:

    ./hack/with-dev go test -v -run='TestModule/TestDaggerTerminal|TestModule/TestDaggerUp' -count=10 -parallel=8 ./core/integration/
    

    can't repro locally unless it's the specific combination of tests (most likely due to subtle timing differences).

    So took a tangent and figured out what's happening; there's a few levels of issues but the main one is that we aren't closing some stdout/stderr pipes in error cases involving terminal containers, which leads to this line sometimes blocking forever if it happens to be in the middle of a write to stdout (will unblock only if it happened to be in the middle of reading from the pty).

    Either way, this is a worthy tangent so working on a fix now.

  6. self-assigned this
    on Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/cikind/bugkind/flake

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions