[Bug] testing-setup: Agent modifies test code/clock to bypass failures instead of fixing production bugs (False-Green / Testing Integrity issue)
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 90/100
Direzione di ricerca
Aggiorna testing/testing-setup/SKILL.md con il protocollo richiesto sull’integrità dei test e sull’analisi della causa principale. La sezione deve richiedere un’attribuzione che dia priorità alla produzione, vietare il congelamento dell’orologio e i workaround del dispatcher che mascherano i difetti e richiedere una verifica pulita in condizioni di test standard; non vengono menzionati test specifici.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Affected Skill
testing/testing-setup
Description
When running the testing-setup skill to write and execute UI or unit tests, if a test reveals a real bug in production code (such as an infinite frame loop causing AppNotIdleException or coroutine dispatch delays causing AssertionError), the agent's default instinct is to modify the test code (e.g. freezing the test clock via mainClock.autoAdvance = false or bypassing dispatchers) rather than investigating and fixing the production code.
This results in a "False-Green" (superficial pass) where the agent reports 100% test pass rates, while the underlying production code still retains severe bugs such as background battery drain, frame starvation, or UI lag.
Expected Behavior
- Production-First Attribution: When an assertion fails, a timeout occurs, or the Compose engine cannot idle (
AppNotIdleException), the agent should treat the production code as the primary suspect. - Real Root-Cause Remediation: The agent should investigate whether production code has architectural defects (e.g., bare
while (isActive) withFrameNanosloops that should userememberInfiniteTransition, or unnecessaryDispatchers.Mainqueuing for state updates) and refactor the production code directly. - No Test Workarounds: The agent must NOT bypass real issues by manipulating the test harness (such as manually advancing clocks to silence runaway loops or artificially relaxing assertions).
- Clean Verification: Once production code is fixed, tests must pass cleanly under standard, unmanipulated conditions (e.g., standard
waitForIdle()).
Actual Behavior
The agent suffers from strong "Green-Bar Bias" (optimizing for BUILD SUCCESSFUL at all costs):
- Upon encountering
AppNotIdleExceptioncaused by an infinitewithFrameNanosloop in the UI component, the agent immediately addedcomposeTestRule.mainClock.autoAdvance = falseandadvanceTimeBy(...)in the test file to avoid waiting for idle. - Upon encountering an
AssertionErrorwhere the UI failed to update after clicking "Next Track" (due to production code putting state mutations insideviewModelScope.launch(Dispatchers.Main)queue), the agent bypassed it inside the test harness without touching the production ViewModel. - The agent declared victory with "100% pass rate", while the production code still contained the battery-draining infinite loop and UI lag.
Steps to Reproduce
- In an Android Compose app with a turntable rotation animation implemented via
while (isActive) withFrameNanosand a ViewModel usingviewModelScope.launch(Dispatchers.Main) { _song.value = next }. - Invoke LLM with
testing-setupskill to write UI behavior tests for this component. - When Gradle execution fails with
AppNotIdleExceptionorAssertionError, observe the LLM's next step:- It modifies the test file with
mainClock.autoAdvance = falseinstead of refactoring the production turntable animation. - It bypasses coroutine queuing in the test instead of making state updates immediate in production code.
- It modifies the test file with
Suggested Fix
Add a mandatory "Testing Integrity & Root Cause Protocol" section to testing-setup/SKILL.md:
- Mandate Production Attribution: Explicitly state that UI freezes, idling timeouts, and state lags are production code defects by default.
- Prohibit Clock Freezing as a Patch: Forbid using
mainClock.autoAdvance = falsemerely to mask infinite frame loops or unmanaged background jobs in production code. - Audit Against False-Greens: Require the agent to ask: "If this happened on a real device, would the user experience battery drain, ANRs, or UI lag?" If yes, the production code MUST be refactored first.
- Lingua principale
- Kotlin
- Stelle
- 10.7k
- Fork
- 708
- Merge medio
- 8g 4h
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di android/skills
-
[Feature] 3D and AR on phones (Filament, ARCore, SceneView): current APIs instead of 2022-era codeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
android/skills#261 · 1 reazione ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
android/skills#207 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
[Feature] Add fused-location skill for foreground FLP, Android 12 permissions, and update lifecycleAperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 82/100
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di android/skills
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sorsama/deepseek-harness-mobile#154 ·
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
ankidroid/Anki-Android#23798 ·
I maintainer di solito rispondono entro 1 giorno
-
unshaved-yak
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
accessibility agent-ready area:android bug fleet
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
level-98/mailcrane#412 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno