Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Clean up resources in ViewController tests #47792

Merged
merged 1 commit into from
Nov 8, 2023

Commits on Nov 8, 2023

  1. [macOS] Clean up resources in ViewController tests

    Wraps all FlutterViewController tests in an autorelease pool to ensure
    resources are cleaned up.
    
    Adds a MockFlutterEngineTest subclass of AutoreleasePoolTest that
    creates an OCPartialMock FlutterEngine and shuts it down at the end of
    the test. Previously we were not shutting down any FlutterEngine
    instances we allocated, resulting in potentially thousands of threads
    and graphics contexts being allocated.
    
    Prior to this change, running these tests via:
    
        ../out/host_debug_unopt_arm64/flutter_desktop_darwin_unittests \
            --gtest_filter='FlutterViewController.*' --gtest_repeat=1000
    
    resulted in test failures and sometimes segfaults. This ensures
    resources are cleaned up
    
    Eventually all unit tests should configure their FlutterEngine via
    either FlutterEngineTest (which should be an AutoreleasePoolTest) or
    MockFlutterEngineTest, and the CreateMockFlutterEngine function moved to
    a static used in the implementation of these.
    
    Issue: flutter/flutter#104789
    Issue: flutter/flutter#127441
    Issue: flutter/flutter#124840
    cbracken committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    13da3c0 View commit details
    Browse the repository at this point in the history