Skip to content

Commit 0b18816

Browse files
authored
Fix test timeouts related to weak null safety (#2416)
1 parent d4f9f67 commit 0b18816

12 files changed

+583
-690
lines changed

Diff for: dwds/test/build_daemon_circular_evaluate_test.dart

+5-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import 'package:test_common/test_sdk_configuration.dart';
1010

1111
import 'evaluate_circular_common.dart';
1212
import 'fixtures/context.dart';
13-
import 'fixtures/project.dart';
1413

1514
void main() async {
1615
// Enable verbose logging for debugging.
@@ -19,14 +18,9 @@ void main() async {
1918
final provider = TestSdkConfigurationProvider(verbose: debug);
2019
tearDownAll(provider.dispose);
2120

22-
for (var nullSafety in NullSafety.values) {
23-
group('${nullSafety.name} null safety |', () {
24-
testAll(
25-
provider: provider,
26-
compilationMode: CompilationMode.buildDaemon,
27-
nullSafety: nullSafety,
28-
debug: debug,
29-
);
30-
});
31-
}
21+
testAll(
22+
provider: provider,
23+
compilationMode: CompilationMode.buildDaemon,
24+
debug: debug,
25+
);
3226
}

Diff for: dwds/test/build_daemon_evaluate_test.dart

+5-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:test_common/test_sdk_configuration.dart';
1111

1212
import 'evaluate_common.dart';
1313
import 'fixtures/context.dart';
14-
import 'fixtures/project.dart';
1514

1615
void main() async {
1716
// Enable verbose logging for debugging.
@@ -20,14 +19,9 @@ void main() async {
2019
final provider = TestSdkConfigurationProvider(verbose: debug);
2120
tearDownAll(provider.dispose);
2221

23-
for (var nullSafety in NullSafety.values) {
24-
group('${nullSafety.name} null safety |', () {
25-
testAll(
26-
provider: provider,
27-
compilationMode: CompilationMode.buildDaemon,
28-
nullSafety: nullSafety,
29-
debug: debug,
30-
);
31-
});
32-
}
22+
testAll(
23+
provider: provider,
24+
compilationMode: CompilationMode.buildDaemon,
25+
debug: debug,
26+
);
3327
}

Diff for: dwds/test/evaluate_circular_common.dart

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ void testAll({
1919
required TestSdkConfigurationProvider provider,
2020
CompilationMode compilationMode = CompilationMode.buildDaemon,
2121
IndexBaseMode indexBaseMode = IndexBaseMode.noBase,
22-
NullSafety nullSafety = NullSafety.sound,
2322
bool useDebuggerModuleNames = false,
2423
bool debug = false,
2524
}) {
@@ -30,9 +29,8 @@ void testAll({
3029
);
3130
}
3231

33-
final testCircular1 = TestProject.testCircular1(nullSafety: nullSafety);
32+
final testCircular1 = TestProject.testCircular1();
3433
final testCircular2 = TestProject.testCircular2(
35-
nullSafety: nullSafety,
3634
baseMode: indexBaseMode,
3735
);
3836

Diff for: dwds/test/evaluate_common.dart

+2-17
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ void testAll({
2121
required TestSdkConfigurationProvider provider,
2222
CompilationMode compilationMode = CompilationMode.buildDaemon,
2323
IndexBaseMode indexBaseMode = IndexBaseMode.noBase,
24-
NullSafety nullSafety = NullSafety.sound,
2524
bool useDebuggerModuleNames = false,
2625
bool debug = false,
2726
}) {
@@ -32,9 +31,8 @@ void testAll({
3231
);
3332
}
3433

35-
final testProject = TestProject.test(nullSafety: nullSafety);
36-
final testPackageProject =
37-
TestProject.testPackage(nullSafety: nullSafety, baseMode: indexBaseMode);
34+
final testProject = TestProject.test();
35+
final testPackageProject = TestProject.testPackage(baseMode: indexBaseMode);
3836

3937
final context = TestContext(testPackageProject, provider);
4038

@@ -302,19 +300,6 @@ void testAll({
302300
skip: 'https://github.com/dart-lang/webdev/issues/1371',
303301
);
304302

305-
test('uses correct null safety mode', () async {
306-
await onBreakPoint(mainScript, 'printLocal', (event) async {
307-
final isNullSafetyEnabledExpression =
308-
'() { const sound = !(<Null>[] is List<int>); return sound; } ()';
309-
final result = await getInstanceRef(
310-
event.topFrame!.index!,
311-
isNullSafetyEnabledExpression,
312-
);
313-
final expectedResult = '${nullSafety == NullSafety.sound}';
314-
expect(result, matchInstanceRef(expectedResult));
315-
});
316-
});
317-
318303
test('does not crash if class metadata cannot be found', () async {
319304
await onBreakPoint(mainScript, 'printStream', (event) async {
320305
final instanceRef =

0 commit comments

Comments
 (0)