mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
test(mobile): remove flaky channel collection assertion (#8440)
Remove the intermittent `departed channel composer and route are collectible` test introduced in [#8419](https://github.com/block/buzz/pull/8419), as requested after its CI failure could not be reproduced in focused macOS and Linux investigation. Keep the Flutter upgrade containing the upstream leak fix and all other tests. No replacement GC-based test is added. ### Validation All 379 remaining channel tests pass, along with formatting and analysis. The broad local gate was stopped during unrelated Rust compilation; no full-gate pass is claimed. Signed-off-by: Tom Brow <tomb@block.xyz>
This commit is contained in:
@@ -31,7 +31,6 @@ import 'package:flutter/rendering.dart'
|
||||
SemanticsNode;
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:leak_tracker/leak_tracker.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart' as http_testing;
|
||||
@@ -100,7 +99,6 @@ part 'channel_detail_page_test/action_row_tests.dart';
|
||||
part 'channel_detail_page_test/bubble_tests.dart';
|
||||
part 'channel_detail_page_test/swipe_reply_tests.dart';
|
||||
part 'channel_detail_page_test/review_avatar_tests.dart';
|
||||
part 'channel_detail_page_test/retention_tests.dart';
|
||||
|
||||
const _channelId = '11111111-2222-4333-8444-555555555555';
|
||||
const _huddleChannelId = '8d764100-fd8f-44cf-9c98-6d8fbd739b8c';
|
||||
@@ -571,7 +569,6 @@ void main() {
|
||||
bubbleLayoutTests();
|
||||
swipeReplyTests();
|
||||
reviewAvatarTests();
|
||||
channelRetentionTests();
|
||||
setUp(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
_testPrefs = await SharedPreferences.getInstance();
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
part of '../channel_detail_page_test.dart';
|
||||
|
||||
void channelRetentionTests() {
|
||||
testWidgets('departed channel composer and route are collectible', (
|
||||
tester,
|
||||
) async {
|
||||
final semantics = tester.ensureSemantics();
|
||||
try {
|
||||
await tester.pumpWidget(
|
||||
_buildTestable(
|
||||
messages: [
|
||||
_textMsg(id: 'message', pubkey: 'alice', content: 'Hello'),
|
||||
],
|
||||
home: Builder(
|
||||
builder: (context) => Scaffold(
|
||||
body: TextButton(
|
||||
onPressed: () => Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (_) => ChannelDetailPage(channel: _testChannel),
|
||||
),
|
||||
),
|
||||
child: const Text('Open channel'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final retired = <WeakReference<Object>>[];
|
||||
for (var visit = 0; visit < 3; visit++) {
|
||||
retired.addAll(await _visitAndLeaveChannel(tester));
|
||||
}
|
||||
// Keep the same app, navigator and semantics owner alive during GC.
|
||||
await tester.runAsync(() => forceGC(fullGcCycles: 3));
|
||||
expect(
|
||||
retired.where((reference) => reference.target != null),
|
||||
isEmpty,
|
||||
reason: 'Departed routes, composers and their portals must be released',
|
||||
);
|
||||
} finally {
|
||||
semantics.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<WeakReference<Object>>> _visitAndLeaveChannel(
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await tester.tap(find.text('Open channel'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Message #general'), findsOneWidget);
|
||||
final composer = find.byType(ComposeBar);
|
||||
final portal = find.descendant(
|
||||
of: composer,
|
||||
matching: find.byType(OverlayPortal),
|
||||
);
|
||||
expect(portal, findsWidgets);
|
||||
final retired = <WeakReference<Object>>[
|
||||
for (final state in tester.stateList(portal)) WeakReference(state),
|
||||
WeakReference(tester.element(composer)),
|
||||
WeakReference(ModalRoute.of(tester.element(composer))!),
|
||||
];
|
||||
Navigator.of(tester.element(composer)).pop();
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(ChannelDetailPage), findsNothing);
|
||||
expect(find.text('Open channel'), findsOneWidget);
|
||||
return retired;
|
||||
}
|
||||
Reference in New Issue
Block a user