Skip to content

Hanging flutter_tester processes #5165

Closed

Description

@AlexandreAndrade00

Describe the bug
The flutter_tester processes aren't terminated.

To Reproduce
Steps to reproduce the behavior:

  1. Run multiple tests with breakpoints
  2. Exit in the middle of the execution

Expected behavior
The flutter_tester processes are terminated

Screenshots
image

Dart Code extension: 3.90.0
Flutter extension: 3.90.0 (activated)

App: Code - OSS
App Host: desktop
Version: linux 1.90.0

Workspace type: Flutter (LSP)

Dart (3.3.1): /home/alexandre/fvm/versions/3.19.3/bin/cache/dart-sdk
Flutter (3.19.3): /home/alexandre/fvm/versions/3.19.3 (Linux (linux-x64/linux))

Activity

  1. DanTup commented on Jul 3, 2024

    @DanTup
    Member

    I can reproduce this in a newly-created Flutter app. Clicking Stop on the debug toolbar sends terminate, which we use to shutdown and we get an Exited event, then send terminated. We then get disconnect but it appears the process is already gone by then.

    [11:47:26 AM] [DAP] [Info] ==> {"command":"terminate","arguments":{"restart":false},"type":"request","seq":16}
    [11:47:26 AM] [DAP] [Info] <== {"seq":2136,"type":"event","body":{"output":"\nExited (-1).\n"},"event":"output"}
    [11:47:26 AM] [DAP] [Info] <== {"seq":2137,"type":"event","body":{},"event":"terminated"}
    [11:47:26 AM] [DAP] [Info] <== {"seq":2138,"type":"response","command":"terminate","request_seq":16,"success":true}
    [11:47:26 AM] [DAP] [Info] ==> {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":17}
    [11:47:26 AM] [DAP] [Info] <== {"seq":2139,"type":"response","command":"disconnect","request_seq":17,"success":true}
    

    It doesn't require breakpoints, just a long-running test also repros:

    import 'package:flutter_test/flutter_test.dart';
    
    void main() {
      testWidgets('Counter increments smoke test', (WidgetTester tester) async {
        await Future.delayed(const Duration(hours: 1));
      });
    }

    I can reproduce this from the terminal, seems unrelated to VS Code / DAP.

    • Create a test with the code above
    • Run in a terminal with flutter test
    • Press Ctrl+C to terminate
    • Check running processes
  2. DanTup commented on Jul 3, 2024

    @DanTup
    Member

    This seems to be a flutter test issue. I've opened flutter/flutter#151230 with steps to reproduce without VS Code or the debug adapter for investigation. (Edit: That was closed as a dupe of flutter/flutter#144222)

  3. added this to the v3.94.0 milestone on Jul 3, 2024
  4. added
    in flutterRelates to running Flutter apps
    in testingRelates to test execution of Dart/Flutter tests for end users
    on Jul 3, 2024
  5. modified the milestones: v3.94.0, On Deck on Jul 23, 2024
  6. DanTup commented on Nov 26, 2024

    @DanTup
    Member

    flutter/flutter#151230 / flutter/flutter#144222 has been resolved in Flutter and I can no longer reproduce orphaned flutter_tester processes (although I do see a slightly different issue - see flutter/flutter#144008 (comment)).

    Closing this on the assumption that this specific issue is resolved (on Flutter master), but please shout if you can still reproduce (and provide steps) on a version that includes flutter/flutter#159115.

  7. modified the milestones: On Deck, v3.102.0 on Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions