mcp tests: bound and back off the follow-up re-read loop in verifyOwnCaller

Aperta Adatta ai principianti
#1,649 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
testing

Direzione di ricerca

Leggi internal/mcp/shared_file_receipt_followup_test.go, concentrandoti sul ciclo for {} in sharedReceiptFixture.verifyOwnCaller, quindi confronta il suo comportamento di ritentativo con le funzioni helper recovered in relation_freshness_watched_matrix_test.go e read_built_projection_retirement_test.go. Aggiungi un limite contenuto ai tentativi e un'attesa tra un tentativo e l'altro, con un messaggio di errore specifico per gli storm. Esegui TestSharedReceiptFollowupVerifiesOriginalReceipt e verifica che le letture durante gli storm siano limitate, mentre le etichette in sospeso senza spiegazione continuino a causare un errore tempestivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

ci-tests mcp

Follow-up from the review of #1635 (for #1634). This is test hygiene and does not block that PR.

Symptom

#1635 adds a re-read loop to the follow-up check. A reply whose only gap is a pending label for main.go is read again when a new watcher generation was witnessed during that read. The loop has no attempt bound and no backoff, so if every read witnesses another generation (a catch-up storm), only the shared 5 s deadline stops it.

A probe injected a newer generation into every reply's label:

  • the loop issued 5,943 to 7,373 get_callers reads in 4 to 5 s;
  • it then failed with follow-up caller response was refused, untyped or truncated, the server's refusal at the deadline, so a triager sees a refusal rather than a storm;
  • caught_up_generations in the test evidence grew without bound, to 7,373 entries in one record;
  • in the four-edits-per-second workload, the spin would spend deadline time that later rows share.

A stuck label still fails at once, because each re-read needs a newly witnessed generation. So this is about load and diagnosability, not a false pass.

Where
  • internal/mcp/shared_file_receipt_followup_test.go: the for {} loop in sharedReceiptFixture.verifyOwnCaller, as added by #1635. It is reached from TestSharedReceiptFollowupVerifiesOriginalReceipt and through sharedReceiptFixture.verifyRefusedCallers.
  • For comparison, the recovered helpers apply the same rule with a bound, and fail with replies after publication kept admitting catch-up generations:
    • watchedMatrixFixture.recovered (relation_freshness_watched_matrix_test.go), 3 attempts;
    • readBuiltRetirementFixture.recovered (read_built_projection_retirement_test.go), 5 attempts.
Evidence
  • Across 2,200 stress runs of the follow-up test with #1635 applied, 31 runs took the re-read path. Each needed exactly one caught-up generation, so a small bound would not have failed any of them.
  • The same storm probe against the matrix recovered helper failed after 3 reads, with the storm message.
  • Every re-read reuses JSON-RPC id 600+ordinal, and the evidence keeps only the last reply. The pending reply that triggered a re-read is lost; only its generation number survives.
Fix direction
  • Bound the loop at a small number of attempts, such as 3 to match the matrix helper.
  • Back off between re-reads instead of re-issuing immediately: for example, wait until the witnessed generation has published, or sleep briefly.
  • When the bound is hit, fail with a message that names the storm, such as "kept admitting catch-up generations".
  • Keep the final-state assertion unchanged. The last reply must be fresh and carry exactly one own edge at the physical line within the shared deadline, and a pending label that no generation explains must still fail on the first read.
  • Optional, in the same change: use a distinct request id per attempt, and keep the first pending reply's freshness block in the evidence.
Done when
  • The storm case fails within the bound, with a storm message, after a bounded number of reads.
  • A stuck or unexplained pending label still fails on the first or second read, as today.
  • Only test files change.

Refs #1634

Lingua principale
Go
Stelle
1.9k
Fork
171
Merge medio
12h 43m
PR unite (30g)
347

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di zzet/gortex

Tutte le issue di zzet/gortex

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.