Add reproducer for check raw file injection smoke-test flake#11361
Closed
bm1549 wants to merge 1 commit into
Closed
Add reproducer for check raw file injection smoke-test flake#11361bm1549 wants to merge 1 commit into
bm1549 wants to merge 1 commit into
Conversation
The dominant failure mode (31 of 41 reports in CI Visibility) is an IndexOutOfBoundsException with toIndex=3 inside parseTraceFromStdOut. The proximate trigger is a partial-read bug in OutputThreads: when rc.read(buffer) returns a chunk with no newline and the inner loop has consumed no lines yet, the fall-through branch adds the partial buffer to testLogMessages as if it were a complete line. The OS pipe splits the child's THIRDTRACEID println under CI load, leaving the smoke test to parse a truncated "THIRDTRACEID 12345" chunk. OutputThreadsTest exercises the buggy path deterministically via a ChunkedInputStream that returns one chunk per read() call. Both tests pass today and will start failing once OutputThreads is fixed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Adds
OutputThreadsTest, a JUnit 5 reproducer for the dominant flake ofcheck raw file injectioninLogInjectionSmokeTest(31 of 41 reports in CI Visibility):The test exercises the buggy path deterministically via a
ChunkedInputStreamthat returns one chunk perread()call. Both tests pass today and will start failing onceOutputThreadsis fixed. That makes them a ready regression test for the fix.Motivation
The proximate trigger is a partial-read bug in
OutputThreads.ProcessOutputRunnable.run(): whenrc.read(buffer)returns a chunk with no newline AND the inner loop has consumed no lines yet, the fall-through branch decodes the partial buffer and adds it totestLogMessagesas if it were a complete line. Under CI load the OS pipe splits the child'sSystem.out.println("THIRDTRACEID <traceId> <spanId>")write. The smoke test then parses a truncated"THIRDTRACEID 12345"chunk viasplit(" ")[1..2]. The Groovy range translates tosubList(1, 3)on a 2-element list, hencetoIndex = 3.Prior fixes (#10920, #10999, #11075) ruled out the assertion bug, the BaseApplication timeout, and process liveness, but left the partial-read issue in place. This reproducer isolates that issue without touching the production code path, so the fix can be reviewed against a deterministic test.
Additional Notes
dd-smoke-tests/src/test/java/, a new test source set for the parent module. AddingtestImplementation(libs.junit.jupiter)makes the JUnit 5 API available at test-compile time; the JUnit Platform runner is already enabled by the project's default Gradle setup.OutputThreadsand flip these tests to assert correct behavior.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueNote: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.