Skip to content

FocusManager.instance.toStringDeep hangs when flutter test specifies --wasm --web-renderer=skwasm #56129

@HansMuller

Description

@HansMuller

Attempting to run a flutter/flutter FocusManager test on MacOS using the master branch:

(cd packages/flutter; flutter test --reporter=expanded -v --platform=chrome --wasm --web-renderer=skwasm --dart-define=DART_HHH_BOT=false test/widgets/focus_manager_test.dart)

The test hangs. The test runs OK if --wasm --web-renderer=skwasm is not specified.

The "debugDescribeFocusTree produces correct output" test consistently hangs here:

String debugDescribeFocusTree() {
  String? result;
  assert(() {
    result = FocusManager.instance.toStringDeep(); //  -- hang -- 
    return true;
  }());
  return result ?? '';
}

Strangely, adding a reference to the toStringDeep method before it's called fixes the problem:

String debugDescribeFocusTree() {
  String? result;
  assert(() {
    FocusManager.instance.toStringDeep; // huh?
    result = FocusManager.instance.toStringDeep(); // does not hang
    return true;
  }());
  return result ?? '';
}

FTR, just adding a reference to FocusManager.instance does not fix the problem.

This issue is currently holding up landing flutter/flutter#151145. I'm going to land the huh? workaround there for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart2wasmIssues for the dart2wasm compiler.triage-automationSee https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions