[Bug] testing-setup: Agent modifies test code/clock to bypass failures instead of fixing production bugs (False-Green / Testing Integrity issue)
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
Research direction
Update testing/testing-setup/SKILL.md with the requested Testing Integrity & Root Cause Protocol. The section should require production-first attribution, prohibit clock freezing and dispatcher workarounds that mask defects, and require clean verification under standard test conditions; no specific tests are mentioned.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Kotlin
- Stars
- 10.7k
- Forks
- 708
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/skills
-
[Feature] 3D and AR on phones (Filament, ARCore, SceneView): current APIs instead of 2022-era codeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 4 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
android/skills#261 · 1 reaction ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
android/skills#207 · 1 comment ·
Maintainers usually reply within 4 days
-
[Feature] Add fused-location skill for foreground FLP, Android 12 permissions, and update lifecycleOpen
Difficulty 2/5 Half a day Newbie friendliness 82/100
Maintainers usually reply within 4 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sorsama/deepseek-harness-mobile#154 ·
Maintainers usually reply within 1 day
-
0. Needs triage enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
ankidroid/Anki-Android#23798 ·
Maintainers usually reply within 1 day
-
unshaved-yak
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
accessibility agent-ready area:android bug fleet
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
level-98/mailcrane#412 · 1 comment ·
Maintainers usually reply within 1 day