Revert "Add performance test suite: memory leak detection + battery drain estimation" (#6495)#7818
Conversation
Greptile SummaryThis PR reverts PR #6495, which introduced a compile error (
Confidence Score: 4/5Safe to merge — the compile error blocking the release pipeline is fixed and the unexecuted test files are cleanly removed. The revert correctly addresses the broken build by removing the uncompiled test suite. The one rough edge is in app_performance_test.dart, where the /tmp path hardcoded as a workaround will silently fail when the test is eventually run on an iOS or Android device, losing output without any visible test failure. app/integration_test/app_performance_test.dart — the /tmp hardcode is the only remaining concern Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["PR #6495 merged\n(June 9)"] --> B["Compile error introduced\nawait in sync void fn\napp_performance_test.dart"]
B --> C["Codemagic build fails\nat Run build runner"]
C --> D["This PR: Revert #6495"]
D --> E["app_performance_test.dart\npartially fixed"]
D --> F["battery_drain_test.dart\nDELETED"]
D --> G["memory_leak_test.dart\nDELETED"]
D --> H["run_performance_tests.sh\nDELETED"]
D --> I["test_driver/integration_test.dart\nDELETED"]
E --> J["_writeResultsToFile\nvoid sync\n/tmp hardcoded"]
J --> K["Silent write failure\non iOS / Android"]
Reviews (1): Last reviewed commit: "Revert "Add performance test suite: memo..." | Re-trigger Greptile |
| final timestamp = DateTime.now().toIso8601String().replaceAll(':', '-'); | ||
| final file = File('${dir.path}/omi_perf_$timestamp.csv'); | ||
| final file = File('/tmp/omi_perf_$timestamp.csv'); |
There was a problem hiding this comment.
The hardcoded
/tmp path works on Linux/macOS but silently fails on Android and iOS — the two primary targets for Flutter integration tests. On Android the path is inaccessible to the app sandbox, and on iOS /tmp doesn't exist. The failure is swallowed by the catch block, so test results will be silently lost whenever the file write fails. The original code used getTemporaryDirectory() for exactly this reason. Since _writeResultsToFile is now void (not async), the async version can't be called directly, but the function can be made async and fire-and-forget via unawaited(), or the path can be resolved synchronously using Platform.environment as a fallback.
| final timestamp = DateTime.now().toIso8601String().replaceAll(':', '-'); | |
| final file = File('${dir.path}/omi_perf_$timestamp.csv'); | |
| final file = File('/tmp/omi_perf_$timestamp.csv'); | |
| final timestamp = DateTime.now().toIso8601String().replaceAll(':', '-'); | |
| // Use TMPDIR env var so this works on iOS/Android sandboxes as well as | |
| // Linux/macOS. Falls back to /tmp only on platforms where it is valid. | |
| final tmpDir = Platform.environment['TMPDIR'] ?? Platform.environment['TMP'] ?? '/tmp'; | |
| final file = File('$tmpDir/omi_perf_$timestamp.csv'); |
Reverts #6495.
That PR broke the release pipeline: it added an
awaitinside a syncvoidfunction inapp/integration_test/app_performance_test.dart, a compile error (await_in_wrong_context) that has failed every Codemagic build at theRun build runnerstep since it merged on June 9 (see #6495 (comment)).Beyond the compile error, the tests it added are not executed anywhere — no CI pipeline runs
integration_test/(test.shonly runstest/, codemagic.yaml never invokesflutter test/flutter drive), and there is no evidence the suite was ever run successfully. Reverting rather than patching: AI-generated test code that shipped without being compiled or executed shouldn't stay onmainon the maintainers' verification budget. It can be resubmitted with proof it runs.This restores
app_performance_test.dartto its previous compiling state and removesbattery_drain_test.dart,memory_leak_test.dart,run_performance_tests.sh, andtest_driver/integration_test.dart.🤖 Generated with Claude Code