Skip to content

Revert "Add performance test suite: memory leak detection + battery drain estimation" (#6495)#7818

Merged
mdmohsin7 merged 1 commit into
mainfrom
revert-pr-6495
Jun 11, 2026
Merged

Revert "Add performance test suite: memory leak detection + battery drain estimation" (#6495)#7818
mdmohsin7 merged 1 commit into
mainfrom
revert-pr-6495

Conversation

@mdmohsin7

Copy link
Copy Markdown
Member

Reverts #6495.

That PR broke the release pipeline: it added an await inside a sync void function in app/integration_test/app_performance_test.dart, a compile error (await_in_wrong_context) that has failed every Codemagic build at the Run build runner step 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.sh only runs test/, codemagic.yaml never invokes flutter 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 on main on the maintainers' verification budget. It can be resubmitted with proof it runs.

This restores app_performance_test.dart to its previous compiling state and removes battery_drain_test.dart, memory_leak_test.dart, run_performance_tests.sh, and test_driver/integration_test.dart.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reverts PR #6495, which introduced a compile error (await inside a sync void function in app_performance_test.dart) that broke every Codemagic build at the Run build runner step. The deleted files (battery_drain_test.dart, memory_leak_test.dart, run_performance_tests.sh, test_driver/integration_test.dart) were never wired into any CI pipeline and had no evidence of being compiled or executed.

  • app_performance_test.dart is partially restored: the async/await is stripped from _writeResultsToFile and the path_provider import is removed, fixing the compile error. However, the replacement uses a hardcoded /tmp path instead of getTemporaryDirectory().
  • The three new test files and the shell script are deleted outright, removing the unexecuted and uncompiled test surface from main.

Confidence Score: 4/5

Safe 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

Filename Overview
app/integration_test/app_performance_test.dart Compile error fixed by making _writeResultsToFile synchronous, but the replacement uses a hardcoded /tmp path that will silently fail on iOS and Android devices
app/integration_test/battery_drain_test.dart File deleted as part of the revert — removes AI-generated, uncompiled, never-executed test code
app/integration_test/memory_leak_test.dart File deleted as part of the revert — removes AI-generated, uncompiled, never-executed test code
app/scripts/run_performance_tests.sh Shell script deleted — was never invoked by CI and is no longer needed
app/test_driver/integration_test.dart Driver file deleted — was the companion to the removed battery/memory test files and is correctly removed alongside them

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"]
Loading

Reviews (1): Last reviewed commit: "Revert "Add performance test suite: memo..." | Re-trigger Greptile

Comment on lines 589 to +590
final timestamp = DateTime.now().toIso8601String().replaceAll(':', '-');
final file = File('${dir.path}/omi_perf_$timestamp.csv');
final file = File('/tmp/omi_perf_$timestamp.csv');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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');

@mdmohsin7 mdmohsin7 merged commit ec09de5 into main Jun 11, 2026
2 of 3 checks passed
@mdmohsin7 mdmohsin7 deleted the revert-pr-6495 branch June 11, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant