Commit graph

22827 commits

Author SHA1 Message Date
Kallen Tu 988c301109 [analyzer] Issue 53927: Disallow final fields to be used in a const context.
Context: Added a field check in https://dart-review.googlesource.com/c/sdk/+/312347 which the goal back then was to cut down on more unnecessary errors, but this seemed to have caused a regression elsewhere.

Reverting this part of the change and other related tests.

Bug: https://github.com/dart-lang/sdk/issues/53927
Change-Id: I0774e050c73e677347caad836dd59c9cba71d044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-11-02 20:46:20 +00:00
Stephen Adams 3595f1e187 [tests] Update some tests for web numbers
Change-Id: I6cf7925779a93cae082e23c2bdf15ac36016eeb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333127
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-11-02 19:30:11 +00:00
Sigmund Cherem 11cf645f9c [tests] increase timeout for long dart2js test.
This test flakes 0.5% of the time due to long compilation times. It
seems to be intended to be a stress test, so increasing the timeout
seems reasonable.

Change-Id: I508b4e42654dbb01fba9d84bea3bf843d7b59c48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333320
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-11-02 17:22:39 +00:00
Sigmund Cherem 7e8a203f1e [ddc] use async-helper in ddc's hot_restart_timer test
This test returned a future, which in other runtimes may mean that
the test would not be awaited for. The test-runner for DDC does include
extra asyncStart/asyncEnd to ensure the test runs to completion.
However, this sporadically caused double reporting and flaky failures
([example][1]).

This change makes the test itself track the async nature of the test,
just like we do in most other tests today.

[1]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8766055193681740753/+/u/test_results/ignored_flaky_test_failure_logs

Change-Id: Ib0edab197db21026d38b40036a1eeaf6edff5ad6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333300
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-11-02 15:37:14 +00:00
Stephen Adams 28a4b55c0a [tests/isolate] Avoid use of deprecated unmodifiable typed data view constructor
Issue: #53785
Change-Id: I205492adcec6432f5503cbf9f015a6ac2e9d6f5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332165
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-11-02 12:45:48 +00:00
Johnni Winther 12c4e22a4d [cfe] Handle various cases ExtensionType
Handles ExtensionType in inference of MapLiteral, inference of
ObjectPattern, and exhaustiveness.

TEST=tests/extension_type/*

Change-Id: I3284da2c69d875e192cf3f004ee1156e1aedd98b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333160
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-02 10:42:48 +00:00
Stephen Adams 248afd5d29 [tests] Migrate language/function_type/test_generator.dart
- Migrate language/function_type/test_generator.dart to null safety.
- Add logic to avoid some tests under `dart2jsProductionMode`.
- Re-run generator.
- `dart format` generated files.

Change-Id: I2d7fd787d0710ae2e844b699b2a25b01744cf78f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333048
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-11-01 18:04:19 +00:00
Stephen Adams 718f9076bd [tests] Make corelib/compare_to2_test work for web numbers
Change-Id: I98d13d92c486851630aa00f42ed981c1acf0ba53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333043
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-31 22:52:40 +00:00
Johnni Winther 72f1591f29 [cfe] Use getTypeAsInstanceOf instead of getInterfaceTypeAsInstanceOfClass
The changes calls to getInterfaceTypeAsInstanceOfClass (et al.) to
getTypeAsInstanceOf to ensure that we take extension types into account.

Change-Id: I7d732cdae8494002b44561cb02c49d58dd0ba67b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332920
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-10-31 22:30:50 +00:00
Ömer Sinan Ağacan 9ed368c2e1 [dart2wasm] Use only JS strings in JSCM
Refactor libraries so that JSCM will only use `JSStringImpl` class for
strings.

The goal is to disentangle the native string classes and `JSStringImpl`
and start testing `JSStringImpl` in isolation.

Changes:

- `dart:_string` is no longer available in JSCM.

- Make `int.toString` external to allow patching it differently in JSCM
  and normal modes.

  `toString` implementations are in `boxed_int_to_string.dart` patch
  files.

- `int.parse` now uses JS `parseInt`. However `parseInt` is not
  compatible with Dart's `int.parse` so this will cause some more test
  failures in JSCM for now.

- Any dependencies to `dart:_string` from JSCM `dart:convert` are
  removed. The library implementation now uses JS `TextDecoder` for
  UTF-8 decoding.

  Note: `TextDecoder` is not available on d8, so text decoding tests
  will fail on d8.

  JSON encoding and decoding in `dart:convert` will be updated in a
  follow-up CL.

- Compiler (translator, constant generator, code generator etc.) is
  updated to allocate the `JSStringImpl`s in JSCM.

Initially this will make some JSCM test fail as `int` parsing is not
quite right, those will be fixed in follow-up CLs.

Co-authored-by: Joshua Litt <joshualitt@google.com>
Change-Id: I366e06f44cdc369d28fe47b24015234260304399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332680
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-10-31 12:58:26 +00:00
Daco Harkes acad65713c [vm] Mark NativeFieldWrapperClasses as base
TEST=build SDK (modified patch files)
TEST=tests/ffi/*
TEST=runtime/vm/*_test.cc
TEST=runtime/tests/vm/dart/*

Closes: https://github.com/dart-lang/sdk/issues/51896
CoreLibraryReviewExempt: VM only.
Change-Id: I349849001adf8f3a62f3d4f94d4bdd295c36ef4d
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,vm-aot-linux-debug-x64c-try,vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291761
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-31 10:23:12 +00:00
Daco Harkes b1525cef56 [ffi/test] Expect crash in status file
Enables running tools/test.py ffi again.

Bug: https://github.com/dart-lang/sdk/issues/53829
Change-Id: I155bcd9a106ea7c48700dd6fb9d4fd97815837d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332762
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-10-31 09:39:25 +00:00
Aske Simon Christensen a212a47c82 Mark FutureOr toString test as requiring nnbd-strong
Closes https://github.com/dart-lang/sdk/issues/53738

Change-Id: I87849051ec2324eb03dbe86673dfa68402320454
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332424
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-10-31 08:26:45 +00:00
Sigmund Cherem e52de71408 [web] adjust transition test.
It is unclear if this will help reduce flakiness and timeouts. Until now
the test was setting the listener and making the transition on the same
microtask. If the transition were to complete before the listener is
fully set up, then that would explain the timeout: the transition event
is never fired at that point.  Honestly, I find this scenario hard to
believe, but regardless it is worth a try.

This small refactor changes the order to ensure the listener is set up
upfront, and only later we initiate the transition.

Change-Id: I3ae2bfae210ef307935c3d7f2aec9af82df1ddd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332625
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-10-31 00:50:11 +00:00
Sigmund Cherem c5baec83a5 [web] Skip mediadevices_test on firefox.
This test appears to flake 88% of the time in FF. One
potential reason could be that FF requires user interaction
(similar to the notification_permissions test), however
I don't have an explanation why it doesn't consistently time-out.

One potential theory is whether this behavior is different depending on
which FF browser version is used, but I don't have the data at the
moment to confirm.

Change-Id: Ib5b2759e0d289e44ff06ab11345c597af6cab0f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332626
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-31 00:05:26 +00:00
Paul Berry d8732e9820 When field promotion fails, report all reasons via context messages.
Previously, if field promotion failed both because the language
version was less than 3.2, *and* for some other reason(s), the
analyzer and CFE only reported the other reason(s). The rationale was
that this was better than reporting just that the language version was
less than 3.2, because if a user upgraded their language version to
3.2 in an attempt to get field promotion to work, and *then* found out
that the property in question was unpromotable for some other reason,
that could be quite frustrating.

With this change, if field promotion fails both because the language
version is less than 3.2 and for some other reason, the analyzer and
CFE report *all* the reasons.

Change-Id: Ib5d3a4621273c1e80d66b66b456119f9053e18b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332485
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-30 21:31:51 +00:00
Daco Harkes 59eb00e00d [test/ffi] Fix tests on Fuchsia
TEST=ffi/external_typed_data_finalizer_test
and others

Change-Id: Ic82e051ad5f551ceeecc0ff41efaa2bb9ee4914a
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332429
Reviewed-by: Tess Strickland <sstrickl@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-30 15:28:20 +00:00
Daco Harkes 7aace2b6da [tests/ffi] Remove unused import
Change-Id: I0772d0146dd7faaed3e51ef4357fac096d23cce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332681
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-10-30 11:25:51 +00:00
Stephen Adams 0a2141b134 [tests] Make language/operators/left_shift_test work for web numbers
Change-Id: I6911a4b6e9d253c94257ccfed3d5d7451e812521
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332491
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-10-27 18:42:28 +00:00
Stephen Adams 68af0bb004 [tests] Fix language/double/int_to_string_test for web numbers
Change-Id: I69413abbeaabe2888d23fa7a37988931b95d59ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332488
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-27 18:07:51 +00:00
Stephen Adams 5e8e6aaefe [tests] Fix web-number edge cases in language/operator/modulo_test
Change-Id: Ia2b919afa3fca7f78c50a3ea089abe4da8dca8c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332372
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-27 18:00:42 +00:00
Stephen Adams 2f52ffa9f1 [test] Make language/number/int2_test parse on web compilers
Change-Id: I5cb78bac3d903d5f78cef4a45bda7a16bdc7c09e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332492
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-27 17:59:49 +00:00
Alexander Aprelev 6a464c9dee Revert "Expire 3.0.0 experiment flags."
This reverts commit 6f29e7fce4.

Reason for revert: broke g3 bot

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Change-Id: Ied6f612dc922824ffdadc4660898f3b859922ff5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332582
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-10-27 16:50:09 +00:00
Stephen Adams ca67a27edd [tests] Don't minify language/unsorted/cyclic_type_test for dart2js
Change-Id: I9295c0b04db8334d6526679c78cf30b1e062e321
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332490
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-10-27 16:47:59 +00:00
Paul Berry 83af09021f Front end: Fix field promotion for extension type representation variable.
Update the type inference algorithm so that `FlowAnalysis.propertyGet`
is appropriately called when analyzing code that refers to the
representation variable of an extension type.

Flow analysis requires an arbitrary `Object` to represent the property
in question; this is later passed to
`OperationsCfe.isPropertyPromotable`. We use the synthetic
"representation field" (which is actually a `Procedure`) for this
purpose
(`ExtensionTypeRepresentationAccessTarget.representationField`).

Representation variables are considered promotable if they are public
(see
https://github.com/dart-lang/language/pull/3411). `OperationsCfe.isPropertyPromotable`
can tell if the representation variable is public by checking the name
of the synthetic representation field.

Fixes #53439.

Bug: https://github.com/dart-lang/sdk/issues/53439
Change-Id: I8f7ff8fcd8e5a43de419b8441951b52a555fda1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332480
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-10-27 16:34:30 +00:00
Paul Berry f644a30069 Test field promotability for fields "passed through" extension types via "implements".
Change-Id: Ic5bbb5eb12259d076b697bce7624cde181d7beb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332484
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2023-10-27 16:23:02 +00:00
Tess Strickland e7fd34b82c [tests] Fix language/type_object/runtime_type_function when obfuscated.
Add the "vm:keep-name" pragma to the class whose name is checked.

Add isObfuscated to guard the check that includes named parameter
names, since currently they are obfuscated, even if the function is
marked with the "vm:keep-name" pragma.

TEST=language/type_object/runtime_type_function on
     vm-aot-obfuscate-linux-release-x64

Fixes: https://github.com/dart-lang/sdk/issues/53879

Cq-Include-Trybots: luci.dart.try:vm-aot-obfuscate-linux-release-x64-try
Change-Id: I7698607ed6e1c95860f2e26ede923320a409eba4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332425
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-27 14:02:22 +00:00
Lasse R.H. Nielsen 6f29e7fce4 Expire 3.0.0 experiment flags.
TEST=Existing tests covers.
Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-27 13:57:00 +00:00
William Hesse adc79bc389 Avoid crashes in string concatenation 32-bit integer overflow test
The test standalone/string_overflow_test.dart is causing crashes
and out-of-memory thrashing on some configurations. It was originally
a regression test that concatenating a string with 2^31 characters
did not overflow a 32-bit signed integer.

It was changed to exponentially grow a string until an out-of-memory
runtime exception is thrown in Dart.  On some VM configurations,
this crashes the machine instead.

Restoring it to only check concatenating a string of 2^31 bytes.

Bug: https://github.com/dart-lang/sdk/issues/46225
Change-Id: Ib50625fe14be2613c907a7bc30cd57766693f6aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332423
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-10-27 12:36:29 +00:00
Sigmund Cherem 73de586423 [web] improve fileapi tests.
These tests had several issues. The fixes are aimed to reduce flakiness
and remove invalid configurations where tests are not providing any
value. Some of the issues include:

* some tests interferered with each other causing a 18% flakiness rate
  in chrome: they used a common file system that ended up being shared
  in a single browser instance. This is why some tests failed when they
  find a file exists before it was created [1].

* some tests were not properly using async_helper/async_minitest, so
  they may complete before they finish executing

* DDC no longer supports these APIs due to
  https://github.com/dart-lang/sdk/issues/53864. We don't intend to fix
  those issues, so there is no purpose in running these tests in DDC at this
  time.

[1]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8766313714239949697/+/u/test_results/ignored_flaky_test_failure_logs

Change-Id: I1dbb28eba2d962000a4d425563dbc1eb6b55dbed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332266
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-10-27 02:25:20 +00:00
Sigmund Cherem 6b8224d2e5 [web] update transition_event_test.
Similar to the request_animation_test, it's unclear the reasons why this
test is hitting flaky timeouts (rate as high as 70% in DDC!).

This change can hopefully improve handling of
asynchrony in the test and help us investigate further.

Change-Id: I5c6023ccfaa7270b1d1e49d902fe9fa168d0d868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332169
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-27 02:05:27 +00:00
Sigmund Cherem e0112afc70 [web] delete notification_permission_test.
This test provides very little value. It requests the notification
permissions and waits for an answer. What's happening is that the test
launches a prompt and then waiting for a user to click on the browser
dialog to accept or reject the request.

On the bots, this is consistently timing out in chrome and safari.
Turns out this issue was [identified][1] 5 years ago and the test was marked
as Timeout in the status files for that reason (dart2js) or skipped
(DDC). Back then there were discussions
about whether we could make chrome automatically accept or reject the
request, but there was no traction on that.

If we thought this test was providing value, we could explore whether
there is a way to make bots automatically accept/reject the prompt by
saving some preferences on the test machines. That said, I'm honestly
not seeing much value here. For that reason, I'm inclined to delete the
test instead.

Other reasons to delete mentioned in the review:
* this API may require a secure context, but our test runner doesn't default to use https yet
* this API requires a [user gesture in FF][2]

[1]: https://github.com/dart-lang/sdk/issues/32002
[2]: https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission_static

Change-Id: Ib8d372b2ebfb5859a0a9bc82d50a14ad8badeab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332320
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-27 02:02:29 +00:00
Sigmund Cherem c439c97b80 [web] improve requestanimationframe test.
This test is flaky and causes timeouts 70% of the time in DDC.

The reasons are not clear at the moment, but I noticed that the
test was not properly using async-helper. This change may help
improve our investigation in the near future.

Change-Id: I834265dd6b898098ee7d5210ffe68ef0a6db74a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332280
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-27 01:56:08 +00:00
Sigmund Cherem 7cf0603208 [web] delete element_animate_omit_timing_test.
This test is 61% flaky in dart2js-chrome and 73% flaky in DDC.

This test is almost identical to
lib/html/element_animate_simple_timing_test (long ago it was a separate
case in the same file that used the html multi test configuration). The
only difference is that this test has no deadline for the animation to
complete, while the other test (which passes consistently) does.

My theory is that not including a deadline is the cause of flakiness and
without it, there isn't ,uch we can control to recover consistency. As
such, I don't think we should be including this test anymore.

Change-Id: I5451dbc7053ba0280a64e1bef2e03cc20465ad88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332170
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-27 01:54:25 +00:00
Stephen Adams cb52932c72 [tests, dart2js] Fix test using minified type names
1. Add `Object` and `Map` to the very short list of names that are
unminified in the app.

2. Tweak test to avoid testing minified name.

Change-Id: Ide0cedc2950b5392eb6963403a48c0f89cd1b50a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332368
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-10-27 01:36:28 +00:00
Stephen Adams 8ee403e86c [tests] Fix some tests for web numbers and dart2js production mode
Change-Id: I05a1814f2a2c5810f75708ba72bfafe137122f67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332486
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-10-27 01:16:28 +00:00
Stephen Adams e19e4bfaaf [tests/io] Avoid use of deprecated unmodifiable typed data view constructor
Issue: 53785
Change-Id: I47c854c1eafec8ffee30852a94eb6183c222442a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332264
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-26 22:46:39 +00:00
Stephen Adams abf89a6803 [tests, dart2js] Make stack-trace tests work on dart2js
Change-Id: I0986f83f5dcc61e285d1f025449ddd0ed8961a0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332520
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-26 21:53:29 +00:00
Sigmund Cherem 8f4d4391e1 [web] delete file_sample_api_test - a flaky and obsolete test.
This test has non-deterministic failures (rate 30% on mac, 10% on linux
and windows) caused likely by a data-race ([example log][1]). The test
has a write to set the contents of a file, and a corresponding read. The
error makes it appear as if the read occurred before the write
completed.

This API is part of the [createWriter][2] proposal, which was abandoned
early on (almost a decade ago) and documented as deprecated. As a result
I believe this test is providing coverage for obsolete functionality.
In fact, the API for the `write` returns void and appears synchronous,
but my guess is that it is not. There is no API to ensure the write
completes as far as I know. An alternative here would be to use timers
to add a significant delay between the operations.

It is also worth noting that the [requestFileSystem][3] API to access
the FileSystem (used here and in the fileapi tests) is also deprecated
and not supported in firefox or safari.

Given the flakiness issue and the fact that this API is already
deprecated, I'm not really seeing the value in keeping the test.

[1]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8767600632278735009/+/u/test_results/ignored_flaky_test_failure_logs
[2]: https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry/createWriter
[3]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestFileSystem

Change-Id: I92ad6399218c6a17cfa029a99b99afcfadde0035
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332282
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-26 20:52:19 +00:00
Stephen Adams 163bd370a0 [tests, dart2js] Make test conditional on dart2js mode
Change-Id: Ibc1a99b4ad95e3df3b6fd85715cd8f0218235771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332300
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-10-26 17:18:28 +00:00
Johnni Winther 931e27753a [cfe] Support inherited combined member signatures
This add support for inherited combined member signatures, both from
source and from dill.

Change-Id: I163f2b30c3242ba98692d7e9b52ef93fd0d6a903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332201
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-10-26 09:56:05 +00:00
Sigmund Cherem e557275397 [web] mark deferred/many_parts_test as slow.
This test has failed with a timeout in a flaky manner: 48% on windows,
13% on linux bots. Unlike other timeouts, this is a legit slow test
because the compiler takes too long to build it. That seems justified
given that this is a stress test for deferred loading, so it is expected
to be slow.

This CL updates the status file for non host-asserts configurations, since the
hostasserts configuration already has 4x budget.

Change-Id: Ie6b53a8c7ef5f6c9b9c6748386db2ae505c2eca2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332281
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-10-26 01:25:55 +00:00
Sigmund Cherem 744231d16e [web] delete native_gc_test.
It seems to me that this test doesn't provide value for the JS backends.
The test was first introduced 11 years ago to investigate and fix GC
issues in Dartium that happened across the Dart/DOM boundary (see
https://github.com/dart-lang/sdk/issues/1448).

While the test works in many configurations, this test is flaky in
dart2js-firefox (37%) and DDC (8-14%).  I haven't investigated the
reasons behind the timeouts, but given the origins of the test, it
doesn't seem worth fixing it.

Change-Id: I3eaf2273209b587ce5ecfcf4a2bbbd9cb8b990fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332167
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-26 01:17:20 +00:00
Sigmund Cherem a7104c813f [tests] update periodic_timer tests to reduce flakiness.
These tests check for lowerbounds on the time it took to fire an
event. Unfortunately, browsers may complete events ahead of time.
This has caused these tests to be flaky in dart2js and ddc [1]

In a local experiment, we've seen timers complete +-15ms from
the expected time. Most often they are around +-5ms, but those more
extreme cases do happen. Recent flakiness logs show some good samples:
* off by 1ms: [2] and [3]
* off by 4ms: [4]
* off by 13ms: [5]

This CL makes two adjustments to reduce flakiness:
* account for the fact that timers may complete early (checking that
  they are >= than the expected timeout - 40ms)
* increase intervals to 50ms in order to prevent overlap between two
  events in the worse scenario that both happen on the extreme variances
  (+15ms and -15ms respectively).

[1]: https://dart-current-results.web.app/#/filter=lib/async/periodic_timer,dart2js,ddc&showAll
[2]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8766776511992750881/+/u/test_results/ignored_flaky_test_failure_logs
[3]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8766798962026535617/+/u/test_results/ignored_flaky_test_failure_logs
[4]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8767378609439308945/+/u/test_results/ignored_flaky_test_failure_logs
[5]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8767357850408867553/+/u/test_results/ignored_flaky_test_failure_logs

Change-Id: Ib46d6f33f5c2b1458f393e8b4c75c84453e73024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331210
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-26 00:56:43 +00:00
Brian Quinlan 097c84f11b [io/doc/test] Modify the Windows symlink resolution behavior so that resolving a link that points to a non-existent file results in a type of notFound, which is consistent with all other platforms.
Bug:https://github.com/dart-lang/sdk/issues/53684
Change-Id: I1b594e1a85906d1f510358eec71792ea15ab801b
CoreLibraryReviewExempt: VM- and doc-only
Tested: unit tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331841
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-10-25 23:14:38 +00:00
Paul Berry c23ac067eb Improve the behavior of "why not promoted" when field promotion disabled.
If the user attempts to promote a property, and their language version
does not permit field promotion, the "why not promoted" logic now
checks whether the language version is the sole reason for the failure
in property promotion. In other words, it checks whether the property
would have been promotable *if* field promotion had been enabled. If
it would, then the context message displayed to the user explains that
the property did not promote because field promotion is not supported
by the current language version.

However, if there is some secondary reason why the property failed to
promote (in other words, if the property would not have been
promotable even if field promotion had been enabled), then the context
message now favors the secondary reason.

Rationale: imagine a user is maintaining a package that doesn't yet
support SDK version 3.2, and that package contains some property
that's non-promotable both because the language version is prior to
3.2 *and* for some other reason (e.g., because the property isn't a
private field). It would be quite frustrating if the user saw a
context message suggesting that the property would be promotable in
SDK 3.2, and then went to a lot of effort to bump their minimum SDK
version, only to discover *after* the bump that the property is still
not promotable.

In the process of making this change, I discovered that the CFE
doesn't support field promotion in patch files. This is because patch
files aren't listed in `SourceLoader.sourceLibraryBuilders`, so the
logic in the `FieldPromotability` is never invoked for those
files. Since patch files are an artifact of SDK development, and will
never be used by end users, it doesn't seem worth going to extra
effort to add this support. However, I've taken care to make sure that
the "why not promoted" logic recovers gracefully in patch files (by
simply not generating a context message).

Change-Id: I6c0d1c0f4b8a7690f6f775408cb5e857b2dd7b03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330241
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-10-25 19:41:26 +00:00
Ryan Macnak b8c6c4d187 [vm, ffi] Handle MultipleNativeLocations that aren't just byte copies.
TEST=ffi/*structs_by_value*
Bug: https://github.com/dart-lang/sdk/issues/48645
Change-Id: I28a139aec3370be9799279325717057d7034b341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332141
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-25 15:57:12 +00:00
Sigmund Cherem 4bcb0950f1 [web] fix improperly migrated tests.
These tests had bugs intronduced during the the null-safety test
migration. Surprisingly the failures didn't show up on some
configurations because the tests were previosly not using the
async-helper wrapper. As a result, the test was logged as completed and
passing before it was done executing. Together this was the cause why
these tests failed in d8 and flaked in firefox.

This CL fixes both issues. A few notes:
* web_2 tests didn't have bugs, but this CL also adds asyncHelper to
  match
* it's quite possible that many of these `is` tests are optimized away
  in dart2js. I added a couple `confuse` calls when the trivial tests
  were highlighted by the analyzer directly (not based on whether or not
  dart2js optimized them away).

Change-Id: I8f58c0b0b850023764524f57201eada89a5c0d6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332062
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-25 15:37:50 +00:00
Johnni Winther e06536af2e [cfe] Create combined member signature stub
This create a stub for combined member signatures from multiple
inherited non-extension type members and adds these to the
extension type declaration.

A sealed [TypeDeclaration] superclass is added to [Class] and
[ExtensionTypeDeclaration] to support accessing the enclosing type
declaration from a [Member].

TEST=existing

Change-Id: Ic01535d27a14187d37b00868e7e90fe73558b051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331181
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-10-25 14:16:00 +00:00
Ryan Macnak 379f8cac14 [vm] Fix build for gcc 13.2.0.
TEST=local build
Change-Id: I32e400efb0f6d5e41b894f495ae2e77352f6f5fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332142
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-25 08:38:28 +00:00