Skip to content

e2e flaky test: AsyncConnectionImpl.ContinueParsingResumesOnTheConnectionsStrand #18634

Closed

Description

@kevinushey

AsyncConnectionImpl.ContinueParsingResumesOnTheConnectionsStrand
(src/cpp/core/http/AsyncConnectionImplTests.cpp:353) fails intermittently in
rstudio-core-tests.

Symptom

../src/cpp/core/http/AsyncConnectionImplTests.cpp:400: Failure
Expected equality of these values:
  handlerCalls
    Which is: 0
  1

Frequency

Measured on macOS arm64 on 2026-08-24, at 0014113 (the test file is
unmodified on the branch I measured from):

  • --gtest_filter='AsyncConnectionImpl.*' -- 9 failures in 15 runs
  • --gtest_filter='AsyncConnectionImpl.ContinueParsingResumesOnTheConnectionsStrand' -- 0 failures in 11 runs
  • full rstudio-core-tests -- reproduced, less often

The test in isolation always passed, so the failure depends on the sibling
tests in the suite running first -- most likely the timing shift they
introduce rather than shared state.

Likely cause

The baseline assertion at line 400 drains the io_context with a single
non-blocking poll():

pConnection->startReading();
ioc.restart();
ioc.poll();
ASSERT_EQ(handlerCalls, 1);

startReading() issues an async_read, but the request bytes written to
peer at line 392 still have to traverse the loopback socket before that read
can complete. poll() runs only the handlers that are ready at that instant,
so when delivery has not landed yet it runs nothing and handlerCalls stays
0. Nothing in the test waits for the read to become ready.

A bounded wait -- ioc.run_for(...), or polling until handlerCalls == 1
with a deadline -- would make the baseline deterministic. Plain run() is not
enough on its own, since the connection stays readable.

Found while reviewing #18630, which does not touch this code: AsyncConnectionImpl
runs several hundred tests before the suite that PR modifies.

Activity

  1. changed the title [-]flaky test: AsyncConnectionImpl.ContinueParsingResumesOnTheConnectionsStrand[/-] [+]e2e flaky test: AsyncConnectionImpl.ContinueParsingResumesOnTheConnectionsStrand[/+] on Aug 26, 2026
  2. self-assigned this
    on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions