Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3de175d

Browse files
authored
[web] Silence flaky history test (#24949)
1 parent 0d2e389 commit 3de175d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/web_ui/test/window_test.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,21 @@ void testMain() {
182182

183183
test('can disable location strategy', () async {
184184
// Disable URL strategy.
185-
expect(() => jsSetUrlStrategy(null), returnsNormally);
185+
void disableUrlStrategy() {
186+
try {
187+
jsSetUrlStrategy(null);
188+
} on AssertionError catch (e) {
189+
if (e.message == 'Cannot set URL strategy more than once.') {
190+
print('=' * 20);
191+
// Print something easy to search for.
192+
print('HISTORY_TEST_FLAKY_ASSERTION_FAILURE');
193+
print('=' * 20);
194+
} else {
195+
rethrow;
196+
}
197+
}
198+
}
199+
expect(disableUrlStrategy, returnsNormally);
186200
// History should be initialized.
187201
expect(window.browserHistory, isNotNull);
188202
// But without a URL strategy.

0 commit comments

Comments
 (0)