Skip to content

Commit 3b056e1

Browse files
natebiggsCommit Queue
authored andcommitted
[dart2wasm] Fix deferred loading tests on optimized configs.
Add -O0 to failing tests so that binaryen is not run on them in any configuration. Also skip 'multi_module_stress_test' on d8/jsshell/jsc as these runtimes fail when trying to create a DataView of the necessary files: https://github.com/dart-lang/sdk/blob/main/sdk/lib/_internal/wasm/lib/js_typed_array.dart#L2460 Bug: #59736 Change-Id: Iccc96fde01776f0179c888ac6bbe13a81d0ee847 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401380 Commit-Queue: Nate Biggs <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
1 parent 72acd9d commit 3b056e1

File tree

4 files changed

+33
-23
lines changed

4 files changed

+33
-23
lines changed

tests/language/deferred/regression_22995_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Test that closurizing a function implies a dependency on its type.
66

7-
// dart2wasmOptions=--extra-compiler-option=--enable-deferred-loading
7+
// dart2wasmOptions=--extra-compiler-option=--enable-deferred-loading -O0
88

99
import "package:expect/expect.dart";
1010

tests/web/wasm/flute_stress_test.dart

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// dart2wasmOptions=--extra-compiler-option=--enable-multi-module-stress-test-mode
5+
// dart2wasmOptions=--extra-compiler-option=--enable-multi-module-stress-test-mode -O0
66

77
import 'dart:async';
88

@@ -12,13 +12,18 @@ import '../../../third_party/flute/benchmarks/lib/complex.dart' as flute;
1212
main() {
1313
asyncStart();
1414
int frames = 0;
15-
runZoned(() {
16-
final startTime = '${DateTime.now().microsecondsSinceEpoch / 1000000}';
17-
flute.main([startTime, '10']);
18-
}, zoneSpecification: ZoneSpecification(print: (_, parent, zone, line) {
19-
parent.print(zone, line);
20-
if (line.contains('AverageFrame')) {
21-
asyncEnd();
22-
}
23-
}));
15+
runZoned(
16+
() {
17+
final startTime = '${DateTime.now().microsecondsSinceEpoch / 1000000}';
18+
flute.main([startTime, '10']);
19+
},
20+
zoneSpecification: ZoneSpecification(
21+
print: (_, parent, zone, line) {
22+
parent.print(zone, line);
23+
if (line.contains('AverageFrame')) {
24+
asyncEnd();
25+
}
26+
},
27+
),
28+
);
2429
}

tests/web/wasm/multi_module_stress_test.dart

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// dart2wasmOptions=--extra-compiler-option=--enable-multi-module-stress-test-mode --extra-compiler-option=--no-js-compatibility
5+
// dart2wasmOptions=--extra-compiler-option=--enable-multi-module-stress-test-mode --extra-compiler-option=--no-js-compatibility -O0
66

77
import 'package:async_helper/async_helper.dart';
88
import 'package:compiler/src/util/memory_compiler.dart' as dart2js;
@@ -14,18 +14,20 @@ main() async {
1414
asyncStart();
1515
final main = 'main.dart';
1616
final entryPoint = Uri.parse('memory:$main');
17-
final platformDillBytes =
18-
await loadFileWrapper('../../../dart2js_platform.dill');
17+
final platformDillBytes = await loadFileWrapper(
18+
'../../../dart2js_platform.dill',
19+
);
1920
final result = await dart2js.runCompiler(
20-
entryPoint: entryPoint,
21-
memorySourceFiles: {
22-
main: 'main() {}',
23-
'package.yaml': '{ "configVersion": 1, "packages": []}',
24-
'binaries': '',
25-
'dart2js_platform.dill': platformDillBytes
26-
},
27-
packageConfig: Uri.parse('memory:package.yaml'),
28-
platformBinaries: Uri.parse('memory:binaries'));
21+
entryPoint: entryPoint,
22+
memorySourceFiles: {
23+
main: 'main() {}',
24+
'package.yaml': '{ "configVersion": 1, "packages": []}',
25+
'binaries': '',
26+
'dart2js_platform.dill': platformDillBytes,
27+
},
28+
packageConfig: Uri.parse('memory:package.yaml'),
29+
platformBinaries: Uri.parse('memory:binaries'),
30+
);
2931
Expect.isTrue(result.isSuccess);
3032
asyncEnd();
3133
}

tests/web/web.status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ wasm/source_map_simple_optimized_test: SkipByDesign # Reads source map file usin
6161
wasm/source_map_simple_test: SkipByDesign # Reads source map file using d8's readbuffer
6262
wasm/uri_base_test: SkipByDesign # Converts Uri.base to file path
6363

64+
[ $compiler == dart2wasm && ( $runtime == d8 || $runtime == jsc || $runtime == jsshell ) ]
65+
wasm/multi_module_stress_test: SkipByDesign # DataView fails to load necessary input file.
66+
6467
[ $compiler == dartk && $runtime == vm ]
6568
new_from_env_test: SkipByDesign # dart2js only test
6669
unconditional_dartio_import_test: SkipByDesign # dart2js only test

0 commit comments

Comments
 (0)