Skip to content

Commit

Permalink
Deflake test
Browse files Browse the repository at this point in the history
  • Loading branch information
liamappelbe committed Dec 12, 2024
1 parent 35f84ce commit b3b799d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/ffigen/test/native_objc_test/block_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ void main() {
}, skip: !canDoGC);

test('Blocking block ref counting new thread', () async {
final completer = Completer();
DummyObject? dummyObject = DummyObject.new1();
DartObjectListenerBlock? block =
ObjectListenerBlock.blocking((DummyObject obj) {
Expand All @@ -780,6 +781,8 @@ void main() {

// Object bound in block's lambda.
expect(dummyObject, isNotNull);

completer.complete();
});

final tester = BlockTester.newFromListener_(block);
Expand All @@ -792,6 +795,7 @@ void main() {
dummyObject = null;
block = null;
tester.invokeAndReleaseListenerOnNewThread();
await completer.future;
doGC();
await Future<void>.delayed(Duration.zero); // Let dispose message arrive.
doGC();
Expand Down

0 comments on commit b3b799d

Please sign in to comment.