Skip to content

fix(#2490): add retry logic for flaky e2e TestAdminInstallUninstall - #2492

Merged
rh-hemartin merged 1 commit into
mainfrom
agent/2490-e2e-flaky-retry
Jun 22, 2026
Merged

fix(#2490): add retry logic for flaky e2e TestAdminInstallUninstall#2492
rh-hemartin merged 1 commit into
mainfrom
agent/2490-e2e-flaky-retry

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Address two failure modes in TestAdminInstallUninstall:

  1. 401 Bad credentials during admin analyze: Add tryRunCLI helper that
    returns an error instead of fataling, and wrap the analyze call in a
    retry loop with backoff (up to 3 attempts, 10s/20s delays). This
    handles transient GitHub propagation delays after repo creation.

  2. Triage workflow not dispatched: Verify the shim workflow file exists
    on the test-repo default branch (with retries) before creating the
    test issue. The shim must be active before it can trigger on
    issues:opened events; without this check, a race between PR merge
    propagation and issue creation can cause the dispatch to silently
    not fire.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Closes #2490

Post-script verification

  • Branch is not main/master (agent/2490-e2e-flaky-retry)
  • Secret scan passed (gitleaks — 7bfb871b7cb7110ae563136761d5df2388399052..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Address two failure modes in TestAdminInstallUninstall:

1. 401 Bad credentials during `admin analyze`: Add tryRunCLI helper that
   returns an error instead of fataling, and wrap the analyze call in a
   retry loop with backoff (up to 3 attempts, 10s/20s delays). This
   handles transient GitHub propagation delays after repo creation.

2. Triage workflow not dispatched: Verify the shim workflow file exists
   on the test-repo default branch (with retries) before creating the
   test issue. The shim must be active before it can trigger on
   issues:opened events; without this check, a race between PR merge
   propagation and issue creation can cause the dispatch to silently
   not fire.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

E2E tests did not run

E2E tests run automatically for org/repo members and collaborators on pull requests.

For other contributors, a maintainer must add the ok-to-test label after the latest push.

See E2E testing guide for details.

@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://8ce141c9-site.fullsend-ai.workers.dev

Commit: 9d8a4c10c22cc2016d74385e96d8b5f43edc00ab

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 22, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:56 AM UTC · Completed 10:07 AM UTC
Commit: 9d8a4c1 · View workflow run →

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [retry-logging] e2e/admin/admin_test.go:172 — The analyze retry log message uses Analyze attempt %d failed, retrying in %s... which differs from the Attempt %d: <reason> format used by other retry loops in the same file (including the shim verification retry added in this same PR). Consider aligning with the established pattern for consistency.
  • [edge-case] e2e/admin/admin_test.go:175 — If tryRunCLI succeeds but returns an empty string, the test proceeds silently. This is pre-existing behavior (the original runCLI call had the same property), not a regression.
  • [retry-pattern-consistency] e2e/admin/admin_test.go:167 — The analyze retry uses increasing backoff (10s, 20s) while other retries in the file use fixed 3–5s delays. The variation is justified by the different failure mode (401 credential propagation vs. resource availability).

Labels: PR modifies e2e test infrastructure to fix flaky test failures

Comment thread e2e/admin/admin_test.go
var analyzeOutput string
for attempt := range 3 {
if attempt > 0 {
delay := time.Duration(attempt*10) * time.Second

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] retry-logging

The analyze retry log message uses 'Analyze attempt %d failed, retrying in %s...' which differs from the 'Attempt %d: ' format used by other retry loops in the same file (including the shim verification retry added in this same PR).

Suggested fix: Align with the established 'Attempt %d: ' log format for consistency within the file.

Comment thread e2e/admin/admin_test.go
delay := time.Duration(attempt*10) * time.Second
t.Logf("Analyze attempt %d failed, retrying in %s...", attempt, delay)
time.Sleep(delay)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] edge-case

If tryRunCLI succeeds but returns an empty string for analyzeOutput, the test proceeds silently. This is pre-existing behavior (the original runCLI call had the same property), not a regression.

Comment thread e2e/admin/admin_test.go
_, err = env.client.GetFileContent(ctx, env.org, forge.ConfigRepoName, layers.VendoredBinaryPath)
require.NoError(t, err, "vendored binary should exist at %s", layers.VendoredBinaryPath)
analyzeOutput := runCLI(t, env.binary, env.token, "admin", "analyze", env.org)
// Retry analyze with backoff to handle transient 401s from GitHub

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] retry-pattern-consistency

The analyze retry uses increasing backoff (10s, 20s) while other retries in the file use fixed 3-5s delays. The variation is justified by the different failure mode (401 credential propagation vs. resource availability).

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge component/e2e End-to-end tests type/bug Confirmed defect in existing behavior labels Jun 22, 2026
@rh-hemartin
rh-hemartin added this pull request to the merge queue Jun 22, 2026
Merged via the queue into main with commit e0240fc Jun 22, 2026
20 checks passed
@rh-hemartin
rh-hemartin deleted the agent/2490-e2e-flaky-retry branch June 22, 2026 10:42
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jun 22, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 10:47 AM UTC · Completed 10:54 AM UTC
Commit: 9d8a4c1 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #2492 — add retry logic for flaky e2e TestAdminInstallUninstall

Overall: This was a clean, efficient agent workflow. The code agent produced a correct fix in a single iteration, the review agent approved with only low-severity style observations, and a human approved and merged within ~50 minutes of PR creation. No rework cycles.

Timeline

  1. Issue e2e: TestAdminInstallUninstall flaky — multiple failure modes #2490 reported flaky TestAdminInstallUninstall e2e failures
  2. Code agent created PR fix(#2490): add retry logic for flaky e2e TestAdminInstallUninstall #2492 (agent/2490-e2e-flaky-retry) with a single commit adding retry logic for two failure modes: 401 errors during admin analyze and race conditions with workflow file propagation
  3. Review agent ran for ~10 minutes, approved with 3 low-severity inline comments (log format consistency, edge case on empty output, backoff pattern variation) — all reasonable observations
  4. Human (rh-hemartin) approved at 10:32 UTC
  5. PR merged at 10:42 UTC

Key observation

The PR modifies e2e test infrastructure, but e2e tests were skipped because the bot author didn't have the ok-to-test label auto-applied. The review agent applied ready-for-merge without e2e validation. While #1424 tracks the review-agent-side of this (not checking CI status before labeling), there's no issue covering the upstream problem: trusted bot PRs should have e2e tests enabled automatically.

Existing coverage

Proposals filed

ifireball pushed a commit to ifireball/fullsend that referenced this pull request Jun 24, 2026
…laky-retry

fix(fullsend-ai#2490): add retry logic for flaky e2e TestAdminInstallUninstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/e2e End-to-end tests ready-for-merge All reviewers approved — ready to merge type/bug Confirmed defect in existing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e: TestAdminInstallUninstall flaky — multiple failure modes

1 participant