Skip to content

[Failing Test]: AsyncWrapperTest.testBufferStopsAcceptingItems flaky on Windows #40448

Closed

Description

@tkaymak

What happened?

AsyncWrapperTest.testBufferStopsAcceptingItems in sdks/java/core fails intermittently in Java Unit Tests (windows-latest) with java.lang.AssertionError: expected:<5> but was:<0>. It passes on Linux and macOS and on reruns.

Seen on PRs that do not touch sdks/java/core:

The test depends on thread timing, an earlier flakiness fix was #38970.

Issue Failure

Failure: Test is flaky

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components

  • Component: Java SDK

Activity

  1. tkaymak commented on Oct 7, 2026

    @tkaymak
    ContributorAuthor

    Related: #40397 tries to address the same failure at AsyncWrapperTest.java:678 (expected:<5> but was:<0>) by raising the DoFn sleep to 1000ms and polling until the buffer count reaches 5. That still depends on timing, and the poll can return as soon as the 5th item is buffered, before the remaining producers have actually been throttled.

    I'm working on a deterministic fix that gates BasicDofn with a CountDownLatch and waits on all producer futures before asserting the buffer count. It also covers testBufferCount, testBufferWithCancellation, testLongItem and testSlowDuplicates, which have the same sleep based race since #38970.

  2. tkaymak commented on Oct 7, 2026

    @tkaymak
    ContributorAuthor

    It failed in 3 of 3 Windows runs so far, the third on the #40447 retrigger with expected:<5> but was:<1>: https://github.com/apache/beam/actions/runs/37615492472

  3. added this to the 2.78.0 Release milestone on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions