Skip to content

test(ci): reset the app before an instrumentation retry - #3619

Merged
stamp-build[bot] merged 1 commit into
mainfrom
agent/lagoon/retry-reset-app-state
Oct 23, 2026
Merged

stamp-build[bot] merged 1 commit into
mainfrom
agent/lagoon/retry-reset-app-state

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Lagoon from raft opened this pull request through Stamp
View in Stamp →


What

composer-session-retirement failed in "Android first-character baseline (emulator)" on #3614 (run 39995481533) and #3604 (run 39996195570), with text="sentsent".

Cause

  1. Attempt 1 was killed because a system provider process died. run-instrumentation-with-retry.sh correctly classed that as an infra-abort and retried.
  2. The retry reopened the same fixture channel, and the composer restored the draft "sent" that attempt 1 had persisted.
  3. The test's own commitText("sent") then produced "sentsent", and the IME-setup wait timed out.

This is not a product or network regression. It reproduces on any build: running the test twice on one emulator without clearing app data fails the second run the same way. I checked that locally with both #3614's APKs and an older green reference build: run 1 passes, runs 2 and 3 fail (sendssent, sendssentsent). With pm clear between runs, both runs pass.

Fix

  • run-instrumentation-with-retry.sh takes an optional INSTRUMENTATION_RETRY_RESET_CMD. It runs only before a retry, never before attempt 1 and never after a pass. If the reset itself fails, that is logged as a warning, not treated as fatal.
  • The first-character suite sets it to adb shell pm clear build.raft.app.connectedtest for connected-runner tests, so a retry starts from attempt 1's state.
  • No assertion is changed.

Notes

Tests

scripts/ci/test_instrumentation_retry_classification.sh gains reset-hook cases: the reset runs exactly once before a retry, and never on a first-attempt pass. That script and test_run_first_character_emulator_suite.sh pass locally.

🤖 Generated with Claude Code

composer-session-retirement failed on #3614 and #3604 with
text="sentsent". Attempt 1 was killed by a dying system provider
(infra-abort, retried), and the retry reopened the same fixture channel
with the composer draft "sent" that attempt 1 had persisted. The test's
own commitText("sent") then made "sentsent". This reproduces on any
build: run the test twice on one emulator without clearing app data, and
the second run fails the same way.

run-instrumentation-with-retry.sh takes INSTRUMENTATION_RETRY_RESET_CMD,
which runs only before a retry. The first-character suite sets it to
`pm clear build.raft.app.connectedtest` for connected-runner tests, so a
retry starts from attempt 1's state. Assertions are unchanged.

Signed-off-by: Lagoon <raft+lagoon@agents.stamp.build>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stamp-build
stamp-build Bot merged commit bfa280d into main Oct 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants