agentop tui: TestSearchDoc_RenderIsLinearInALongLine is flaky on shared CI runners

Aperta Adatta ai principianti
#2,165 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
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
testing-qa

Direzione di ricerca

Inizia con cmd/agentop/tui/searchdoc_test.go e TestSearchDoc_RenderIsLinearInALongLine, che misura il tempo di render con 3.000 e 12.000 ripetizioni. Scegli uno degli approcci proposti per ridurre la sensibilità ai runner condivisi mantenendo al contempo il rilevamento della crescita quadratica, quindi esegui il test Go mirato e il job Go CI (authbridge agentop). Il lavoro è completato quando il test non è più flaky sotto un carico variabile del runner, ma continua a fallire per la crescita di circa 16x causata dal rendering quadratico.

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

Descrizione

TestSearchDoc_RenderIsLinearInALongLine (cmd/agentop/tui/searchdoc_test.go) times render on a line of 3,000 and of 12,000 repetitions, takes the best of 3 runs of each, and fails when 4x the line takes more than 8x the time.

On a busy runner, that ratio can pass 8 when nothing is wrong. On #2164, which doesn't touch the search doc code, "Go CI (authbridge agentop)" failed with:

searchdoc_test.go:129: 4x the line took 8.5x the time (132ms → 1.12s): render is not linear

The same job's earlier red on another PR (#2157) is very likely the same test.

Why it flakes: the two sizes are timed at different moments, so a noisy neighbour that slows only the second measurement inflates the ratio. Three runs of each aren't enough to filter that out.

Possible fixes, any one of which keeps catching the regression the test exists for (a quadratic render shows about 16x for 4x the line):

  • loosen the bound to about 12x, which is still well below a quadratic's 16x;
  • interleave the measurements (small, large, small, large…) and take the best of more runs, say 7, so both sizes see the same load;
  • check how the work grows instead of the time: count the operations or allocations of render, which don't depend on the runner;
  • move the timing to a benchmark, and keep only a correctness test in CI.

Assisted-By: Claude (Anthropic AI) [email protected]

Lingua principale
Go
Stelle
31
Fork
49
Merge medio
9h 43m
PR unite (30g)
367

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 rossoctl/cortex

Tutte le issue di rossoctl/cortex

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.