Commit Graph

2803 Commits

Author SHA1 Message Date
Ryan Macnak b3beefb5bd [test] Await closing server socket before reusing the same fixed port.
Bug: https://github.com/dart-lang/sdk/issues/51477
Change-Id: I591fb791d262d392212995bd75b6ff865b9fc5df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427323
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-05-19 14:16:59 -07:00
Ryan Macnak 119116f8a6 [gardening] Mark some slow tests.
Change-Id: I68c45a230a77819af29264eb352cba35e3036787
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427326
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-05-07 19:47:04 -07:00
Robert Nystrom a323c55162 Format tests/standalone/ using 3.8 style.
Change-Id: I4d492a63a41880ef8cd69321372a4853825b9efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426321
Reviewed-by: Liam Appelbe <liama@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2025-05-04 17:45:09 -07:00
Alexander Markov 0fe2a31b2a [tests] Fix flaky standalone/io/http_auth_test
This is an attempt to fix flaky failure

```
Unhandled exception:
Exception: Fatal: asyncStart() was called even though we are done with testing.. This is most likely a bug in your test.
#0      asyncStart (package:expect/async_helper.dart:53)
#1      asyncExpectThrows (package:expect/async_helper.dart:140)
#2      testMalformedAuthenticateHeaderWithAuthHandler.<anonymous closure> (file:///C:/b/s/w/ir/tests/standalone/io/http_auth_test.dart:263)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:951)
#4      Future._propagateToListeners (dart:async/future_impl.dart:980)
#5      Future._completeWithValue (dart:async/future_impl.dart:723)
#6      Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:807)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:42)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:60)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:127)
#10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:194)

--- Re-run this test:
python3 tools/test.py -n vm-aot-win-release-x64 standalone/io/http_auth_test
```

The test has multiple calls to asyncExpectThrows which uses
asyncStart/asyncEnd, but only one top-level asyncStart/asyncEnd is
allowed.

In addition to a top-level asyncStart/asyncEnd, also add
asyncStart/asyncEnd around creation and shutdown of the server in order
to make sure all test cases are completed before test is finished.

TEST=standalone/io/http_auth_test

Change-Id: Ibb55dbae2c2e48e18f51f9a0adc24101d6121a8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425600
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-04-30 17:03:43 -07:00
Brian Quinlan b91e7565fa [io] Fix a flaky tests caused by modifying the CWD
Bug:https://github.com/dart-lang/sdk/issues/60439
Change-Id: I8c3af013b168b93b6ca572f9ae58a6c466d1edfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420503
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-04-28 11:24:39 -07:00
Ryan Macnak 45d187e0ef [test] Mark check_for_aot_snapshot_jit_test as Slow.
Change-Id: I9275e90431907c5e730bd895a2db75be260ab53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424280
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-04-23 14:45:44 -07:00
Brian Quinlan 9d6d5adba9 [io] Fix a test failure when there are multiple linked paths to tmp
The only semantic change is to `testAbsolute`

Change-Id: Ie6f5ed3265163176e0a5f16ca23f7da5f058fe75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420520
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-04-04 17:35:40 -07:00
asiva 284a7ee8c5 [VM/IO] Fix error path in SocketAddress::GetSockAddr
Dart_TypedDataReleaseData was not called in an error path.

Should fix https://github.com/dart-lang/sdk/issues/60421

TEST=tests/standalone/io/datagram_error_test.dart

Change-Id: I1935af1c5beed9d696a0543d0e97f2d549743879
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418701
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-03-28 14:49:19 -07:00
asiva 8af371c1e8 Fix for App crash when File class receive an empty string
TEST=new test added
Change-Id: I575d85c5ab13a2094114a6fa2a7fe9f06ebeabe4
FIXES: https://github.com/dart-lang/sdk/issues/60331
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417962
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-03-26 21:26:49 -07:00
Alexander Markov 325cd9ecec [tests] Attempt to fix flaky standalone/io/named_pipe_type_test
This test has been failing the following error:

Unhandled exception:
Expect.fail('../itxkmd5wzq/named_pipeTGADTD/typeScript: Error: Error when reading '../itxkmd5wzq/named_pipeTGADTD/typeScript': No such file or directory
')


This could happen if the script file has not been written to disk
by the time a sub-process is started.

In order to fix that, non-awaited File.writeAsString is replaced
with File.writeAsStringSync.

TEST=standalone/io/named_pipe_type_test

Change-Id: Ied68c458a04e7c2a5eb20131bea459cb628e1d97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417085
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-03-21 10:24:51 -07:00
Alexander Markov 4e00733aec [tests] Fix flaky standalone/io/http_auth_bearer_test
This test uses multiple asyncExpectThrows which are built on top of
asyncStart/asyncEnd. Multiple top-level asyncStart/asyncEnd is not
allowed, which caused the folllowing flaky error:

  Exception: Fatal: asyncStart() was called even though we are done with testing.. This is most likely a bug in your test.

This change adds a top-level asyncStart/asyncEnd to enclose individual
test cases. Also, awaits are added to make sure all test cases are
completed before issuing the final asyncEnd.

TEST=standalone/io/http_auth_bearer_test

Change-Id: Ie0165c7a845928848451cfe37cf26e1292d208c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417221
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-03-21 10:24:00 -07:00
Brian Quinlan cfd5448971 Add credentials for bearer token authentication
Closes https://github.com/dart-lang/sdk/pull/60048

GitOrigin-RevId: bbed1f2de96aade0e227aaeaf221d90d7ece5c5d
Change-Id: I22c5141f942d2986d0927f13e31beca0ffcc36ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408241
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-03-14 14:55:33 -07:00
Mylo Fawcett 54c8719dfa [io] Correct websocket close code upon abnormal closure
TEST=tests/standalone/io/web_socket_abnormal_close_test.dart

R=omersa@google.com

Bug: https://github.com/dart-lang/sdk/issues/60217
Change-Id: I6168abfa9fc0228f98b97f7873449970f59f1a30
Fixes https://github.com/dart-lang/sdk/issues/60217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413140
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Mylo Fawcett <mylo.fawcett@gmail.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-03-12 02:47:25 -07:00
Martin Kustermann ee32a22712 [gardening] Make standalone/regress_52715_test more robust
The `vm-service` is starting somewhat concurrently with the `main` isolate
and the `main` can therefore not assume it's the only one allocating
memory in the process.

By delaying the measurement logic in `main`, it's more likely the
`vm-service` will have done it's work and reached steady memory state.

This makes the test more robust.

Change-Id: I5a641ad98ba269b8c5961ea6d20b06223621a4e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413641
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2025-03-05 04:58:05 -08:00
Brian Quinlan 7d7af3bf09 [io] Remove assertion for socket timeout exception contents.
Change-Id: I91648caa2d5e53013a1f53412ec5478f5bf4b719
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413326
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-03-04 08:07:14 -08:00
Brian Quinlan fa3461bfad [io] When (SecureSocket|Socket).startConnect fails due to timeout, include a OSError("Connection timed out", 110) in the SocketException.
This allows the developer to determine the reason for the failure without parsing the exception message.

Bug:https://github.com/dart-lang/sdk/issues/60161
Change-Id: I27a6a81be7a83fe2fa0cbbdaf040af3f7fa38f13
Tested: unit tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412184
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-03-03 14:07:46 -08:00
Alexander Markov b2c8b31af3 [tests] Fix flaky standalone/io/http_auth_digest_test
This test has a few independent calls to asyncExpectThrows which uses
asyncStart/asyncEnd. However, multiple top-level asyncStart/asyncEnd
are not allowed, which causes the following flaky error:

```
Unhandled exception:
Exception: Fatal: asyncStart() was called even though we are done with testing.. This is most likely a bug in your test.
#0      asyncStart (package:expect/async_helper.dart:53)
#1      asyncExpectThrows (package:expect/async_helper.dart:140)
#2      testMalformedAuthenticateHeaderWithAuthHandler.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/tests/standalone/io/http_auth_digest_test.dart:345)
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:951)
#4      Future._propagateToListeners (dart:async/future_impl.dart:980)
#5      Future._completeWithValue (dart:async/future_impl.dart:723)
#6      Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:807)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:40)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)
#9      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:128)
#10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:195)

--- Re-run this test:
python3 tools/test.py -n vm-aot-ubsan-linux-release-x64 standalone/io/http_auth_digest_test
```

This change attempts to fix this by adding a top-level asyncStart/asyncEnd
and also asyncStart/asyncEnd to the server start/shutdown to
enclose each test case into asyncStart/asyncEnd and avoid printing
"unittest-suite-success" marker before all test cases are finished.

TEST=standalone/io/http_auth_digest_test

Change-Id: I950e7c6c09f5c2144da874ab3be3cd3a130d3790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411086
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-02-20 20:01:52 -08:00
Ryan Macnak 6d37abbee3 [test] Disable embedder futures test on simulated architectures.
The VM's simulator cannot run FFI calls.

Bug: https://github.com/dart-lang/sdk/issues/37299
Change-Id: If481732d715f483454f8426a8bf78967a35b0be2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409520
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-02-12 14:16:49 -08:00
Ivan Inozemtsev 51ea42537a Add support for flushing microtasks in dart_engine.h
Also add a sample for calling Dart functions which return/accept futures.

Change-Id: I932d0577709f4e068ccd3212797751ecb347c4f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408281
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-02-12 11:10:25 -08:00
Ryan Macnak 5c6f92fe47 [test] Unskip many tests in reload stress testing.
Change-Id: I9ef008b00bb043b210d18659a49ee07fde081f67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409202
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2025-02-11 12:49:41 -08:00
Ryan Macnak fc34e6ec9d [test] Skip named_pipe_script_test in reload stress testing.
It's not possible to re-read source from a pipe.

Bug: https://github.com/dart-lang/sdk/issues/36254
Change-Id: I22cafd5ce0eaadc7d3d172219cb5cb8bbed27f91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409201
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-02-11 10:38:49 -08:00
Ivan Inozemtsev e534983216 Linkable AOT snapshots on macOS
Update `aot_snapshot` template to optionally build a shared library
from `app-aot-assembly` sanpshot.

Change-Id: Ifb7cee65b5699099fa676312fff7d687cfb52d98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407060
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2025-02-03 23:31:21 -08:00
Paul Sturm f5e6ff5095 Avoid throwing an exception if authentication isn't requested
Only process authentication if there are credentials available or an
authenticate callback to get credentials. This prevents an exception
being thrown for a malformed www-authenticate header when the client
code hasn't asked HttpClient to perform authentication.

R=sra@google.com

Bug: https://github.com/dart-lang/sdk/issues/46442
Change-Id: I3d3e70cec936f717f822b2fe170ddc526a74ebf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405280
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-01-28 12:32:24 -08:00
Ivan Inozemtsev 6e33c95463 Dart Engine
Adds shared libraries for embedding Dart VM and new API (runtime/engine/include/dart_engine.h).

TEST=tests/standalone/embedder_samples_test.dart

Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv32-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-linux-product-x64-try,vm-aot-linux-release-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-product-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-linux-release-x64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-aot-win-product-x64-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-appjit-linux-product-x64-try,vm-appjit-linux-release-x64-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try,vm-gcc-linux-try,vm-linux-debug-ia32-try,vm-linux-debug-simriscv32-try,vm-linux-debug-simriscv64-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-release-arm64-try,vm-linux-release-ia32-try,vm-linux-release-simarm-try,vm-linux-release-x64-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-mac-release-arm64-try,vm-mac-release-x64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,vm-msvc-windows-try,vm-reload-linux-debug-x64-try,vm-reload-linux-release-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-reload-rollback-linux-release-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try,vm-win-release-x64-try
Change-Id: Ia4e4d1b871ddef515cfb2f4639bdaa9fe3676936
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402860
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-01-28 03:53:40 -08:00
Brian Quinlan 101e028d1f [io] Fix a bug where NUL was allowed in HTTP headers.
Bug:https://github.com/dart-lang/sdk/issues/56636
Change-Id: I88c579cfaaf0884cb3b582084b8739b060d8f439
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402541
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2025-01-02 12:13:15 -08:00
Brian Quinlan a286ce72ef [io]: Fix a bug where HttpResponse.writeln did not honor the charset.
Bug:https://github.com/dart-lang/sdk/issues/59719
Change-Id: Ie2606b557b1f9f50d52de23c56d36b45e52efda1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402281
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-12-26 11:12:53 -08:00
Ivan Inozemtsev a7fe1e6f55 Embedder samples tests
TEST=new test for ci

Change-Id: I982583ef21c5907bde1dcbc1c34e57c2c0fae770
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398902
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2024-12-24 02:54:52 -08:00
Jens Johansen 2b5b3163e6 [status_file] Status file linting should not check for non-existing files when given input on stdin
Given input on stdin it has no path to resolve the relative paths that
exists in a status file from. It will thus complain about almost all
lines which is not ideal.
This CL changes it so it doesn't check for it when given data on stdin.
This also means that - because there are no old errors on that account -
if there are such errors now you will be forced to fix it.
The current errors in the status files I could find have also been
fixed.

This should for instance have flaggen when I in
https://dart-review.googlesource.com/c/sdk/+/400320 updated the
pkg.status file but forgot to actually rename the underlying file
(as fixed in https://dart-review.googlesource.com/c/sdk/+/400560).
Technically I suppose it _did_ flag it, but there were also hundreds of
lines of false positives caused by the old status file been given at
stdin to check if there were existing errors - which there then was, thus not forcing me to do anything.

Logical follow-up to https://dart-review.googlesource.com/c/sdk/+/370886

TEST=ci
Change-Id: Ib3533ede88b6d99a31f8b423c00930857e0ba49f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400620
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-12-13 05:37:29 -08:00
Vyacheslav Egorov e2c8c234ab [io] Fix _NativeSocket.shutdownRead
When shutting down receive direction we need to ensure that
`closedRead` event is dispatched - as the receive direction
is only considered closed if the available data is drained
and `closedRead` is dispatched.

The code did not account for a possibility that socket has
no available data and as such is not dispatching read events
so closing receive direction and then separately closing
send direction would leave the socket in a state where
both directions are closed but the socket is not disposed
because `closedRead` is not dispatched - such socket objects
will simply leak (even if the other side terminates
the connection).

This CL also updates documentation around `RawSocket.shutdown`
and `RawSocket.readEventsEnabled` to make it clear that
users are responsible for draining accumulated data if
they want to shutdown receive direction.

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

TEST=standalone/io/issue_27414

CoreLibraryReviewExempt: Documentation only changes in VM specific library
Change-Id: I4b0ffb4cc67836c2849ec6e49b788a4f3b4c07d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396340
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-11-27 21:27:03 +00:00
Robert Nystrom 6129842d74 Opt multitests out of formatting in standalone/.
The new formatter supports opting a region of code out from being
formatted. I'm applying this marker to all of the multitests since
those tests are often very sensitive to formatting and easily broken.
This way, anyone touching a multitest (including me when I reformat
the tests) doesn't have to remember to not run the formatter on it.

Change-Id: I06928e08530ad658affd23e594702cff658d8035
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396181
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2024-11-19 00:57:42 +00:00
asiva 8b2b6b2440 Reland ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
This reverts commit 74c5aa3a7a.

Reason for revert: Fix golem breakage by not changing the script dart_precompiled_runtime2

TEST=ci

Original change's description:
> Revert ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
>
> This reverts commit f81a402aa1.
>
> Reason for revert: golem benchmarks are failing to run
>
> TEST=ci
>
> Original change's description:
> > "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
> >
> > Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime
> >
> > This reverts commit 75e6a748f7.
> >
> > TEST=ci
> >

Change-Id: I9efe40643c59bc617f6fb484b89b038deaffbb93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393941
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-11-08 04:36:23 +00:00
Siva Annamalai 74c5aa3a7a Revert ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
This reverts commit f81a402aa1.

Reason for revert: golem benchmarks are failing to run

TEST=ci

Original change's description:
> "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
>
> Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime
>
> This reverts commit 75e6a748f7.
>
> TEST=ci
>
> Original change's description:
> > Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
> >
> > This reverts commit 1b331d05c2.
> >
> > Reason for revert: golem builds are failing
> >
> > Original change's description:
> > > [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
> > >
> > > TEST=ci
> > >
>
> Change-Id: Id0f383eabb496c06c0acebc639c8e3b056ba82d0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393781
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Change-Id: Iec494940412aa31dbefdc5280e35ae99e8cecb26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393764
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-11-06 05:37:46 +00:00
asiva f81a402aa1 "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime

This reverts commit 75e6a748f7.

TEST=ci

Original change's description:
> Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
>
> This reverts commit 1b331d05c2.
>
> Reason for revert: golem builds are failing
>
> Original change's description:
> > [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
> >
> > TEST=ci
> >

Change-Id: Id0f383eabb496c06c0acebc639c8e3b056ba82d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393781
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-06 03:10:31 +00:00
Siva Annamalai 75e6a748f7 Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
This reverts commit 1b331d05c2.

Reason for revert: golem builds are failing

Original change's description:
> [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
>
> TEST=ci
>
> Change-Id: I96ed52994e0d955300c18026032e68003504666d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389760
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Change-Id: I5dc14973f4ee4e577b2c996839d5e497c97fb440
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393761
Commit-Queue: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-05 21:58:09 +00:00
asiva 1b331d05c2 [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
TEST=ci

Change-Id: I96ed52994e0d955300c18026032e68003504666d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389760
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-11-05 20:39:15 +00:00
Devon Carew 6012588e1e [deps] remove unused deps (packages which are now in dart-lang/core)
Change-Id: Ief1a981ea125ac1d2ec5beba6e0535be230bc41e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392467
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2024-10-31 16:06:23 +00:00
Alexander Aprelev 5eaefe724b [io/win/test] Fix socket_udp_readwrite_test to make it more robust.
Fix the test so it works with multiple concurrent instances running.

BUG=https://github.com/dart-lang/sdk/issues/56955
TEST=standalone/io/socket_udp_readwrite_test"

Change-Id: I312c7a846e7ca7288dd6dae3c35abedaf9a50939
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391305
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-10-24 22:11:52 +00:00
Alexander Aprelev ea5fdaafd6 [io/socket/win] Ensure udp sockets survive sending data to unreachable destination.
TEST=tests\standalone\io\socket_udp_readwrite_test.dart
BUG=https://github.com/flutter/flutter/issues/155823

Change-Id: Ic38bc9c022fe3964bcca003bf498c4a5435d5104
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390140
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-10-23 19:13:05 +00:00
Lasse R.H. Nielsen f8086c81ae Collect all test-related files in package:expect.
Collects files from `package:async_helper` and `tests/language`
that are generally useful, so that all test-related helpers are
in `package:expect`.

Moves the two libraries from `package:async_helper` into `package:expect`,
and the `tests/language/static_type_helper.dart` file too.

Deprecates `async_minitest.dart`, to follow `minitest.dart`,
expecting the Flutter use of it to have been fixed to not break
on deprecation (I believe Flutter no longer breaks builds on deprecations at all).

Patch 1 is the actual change.
Patch 2+4+8 is changing all existing references to the files.
Patch 6 ignores deprecation in files still using `async_minitest.dart`.

3+5+7+9 are updating this text to make the numbers match.
Then it's just test-expectations and small tweaks from there.

Change-Id: I1b665135b5fef9b9a0c3b340ffe9daf874d0174c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373120
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-10-11 16:53:52 +00:00
Parker Lougheed c73677e606 [tests] Minor spelling and grammar fixes
Change-Id: I18c309b9037cf94a883443ac9067f911f829516c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388945
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-10-09 08:38:48 +00:00
Vyacheslav Egorov e2efffa005 [vm] Simplify implementation of native ports
This reland commit 5a32d8bc7c with a fix
for thread leak (Issue #56717): when `ThreadPool` is shutting down
asynchronously the last worker should detach itself to prevent
leaking associated low-level data structures, because no thread will
join it.

A hang in service isolate shutdown (caused by an existing bug) was fixed by commit 157a0dc7f9.

This CL turns native ports into a thin abstraction over underlying
thread pool instead of building them as full fledged MessageHandler.

This allows to easily implement a variation of native ports which can
handle messages concurrently with the given degree of concurrency.
This type of port can be used to greatly simplify implementation of
IOService - which previously had to do its own concurrency management
on top of "single threaded" native ports. This capability is exposed
as `Dart_NewConcurrentNativePort` API.

The new implementation is in general much cleaner then the old one
with one exception: `Dart_CloseNativePort` API has unfortunate design
where underlying message handler is destroyed asynchronously and
`Dart_CloseNativePort` returns immediately without waiting for pending
tasks to complete. Implementing this on top of `ThreadPool` requires
some changes to thread pool implementation.

Issue https://github.com/dart-lang/sdk/issues/55844

Closes https://github.com/dart-lang/sdk/issues/56717

TEST=ci

Change-Id: Ic68bfb60757685afd75c80a70cdec66cc13c149b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-09-12 15:16:12 +00:00
Slava Egorov 120dac365d Revert "[vm] Simplify implementation of native ports"
This reverts commit 5a32d8bc7c.

Reason for revert: DartIsolateTest.CanCreateServiceIsolate flutter engine unit test hangs on Windows.

Original change's description:
> [vm] Simplify implementation of native ports
>
> This CL turns native ports into a thin abstraction over underlying
> thread pool instead of building them as full fledged MessageHandler.
>
> This allows to easily implement a variation of native ports which can
> handle messages concurrently with the given degree of concurrency.
> This type of port can be used to greatly simplify implementation of
> IOService - which previously had to do its own concurrency management
> on top of "single threaded" native ports. This capability is exposed
> as `Dart_NewConcurrentNativePort` API.
>
> The new implementation is in general much cleaner then the old one
> with one exception: `Dart_CloseNativePort` API has unfortunate design
> where underlying message handler is destroyed asynchronously and
> `Dart_CloseNativePort` returns immediately without waiting for pending
> tasks to complete. Implementing this on top of `ThreadPool` requires
> some changes to thread pool implementation.
>
> Issue https://github.com/dart-lang/sdk/issues/55844
>
> TEST=ci
>
> Change-Id: I062040ff233e93962ae93684e9b044d8facdaffc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382163
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I7de27793a54072e974bf1a9f17a07c12159a202d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384481
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-09-12 08:25:27 +00:00
tguerin e4b505b366 Propagate http status code when http upgrade request failed
R=mosum@google.com

Change-Id: I547d19da251bdea0c259d3896e6e333f9afd0bca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384522
Auto-Submit: Thomas Guerin <thomas.guerin2@gmail.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-09-11 20:02:14 +00:00
Vyacheslav Egorov 5a32d8bc7c [vm] Simplify implementation of native ports
This CL turns native ports into a thin abstraction over underlying
thread pool instead of building them as full fledged MessageHandler.

This allows to easily implement a variation of native ports which can
handle messages concurrently with the given degree of concurrency.
This type of port can be used to greatly simplify implementation of
IOService - which previously had to do its own concurrency management
on top of "single threaded" native ports. This capability is exposed
as `Dart_NewConcurrentNativePort` API.

The new implementation is in general much cleaner then the old one
with one exception: `Dart_CloseNativePort` API has unfortunate design
where underlying message handler is destroyed asynchronously and
`Dart_CloseNativePort` returns immediately without waiting for pending
tasks to complete. Implementing this on top of `ThreadPool` requires
some changes to thread pool implementation.

Issue https://github.com/dart-lang/sdk/issues/55844

TEST=ci

Change-Id: I062040ff233e93962ae93684e9b044d8facdaffc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382163
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-09-11 13:38:24 +00:00
Lasse R.H. Nielsen 7e75d881a0 Tweak test_runner.
Clean up and optimize some RegExps, and fix uses of `.group`.
Switch to a newer language version, to be able to use newer features.
Add a little documentation about why some RegExps are as they are.

Add (tentative) warning for multitests.

Change-Id: I59f73b87ce30caaeca1c0e0aa7954af1b97abd1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382620
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-09-10 15:29:28 +00:00
Brian Quinlan 9a0eafda2f Skip io/http_big_header_test on simarm
Bug:https://github.com/dart-lang/sdk/issues/52110
Change-Id: I7bb3354b8f2ee1b9466e1b8088d4f18ab494b59c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380581
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-08-20 21:55:43 +00:00
Brian Quinlan d19ef1227b Fix zlib inflation to ignore data past the ADLER32 trailer.
Bug:https://github.com/dart-lang/sdk/issues/56481
Change-Id: I880ca6f546dd28c408066d6b52dd3d3cfba18dfc
Tested: zlib_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380861
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-08-20 18:13:33 +00:00
Alexander Aprelev f9c603e76b [io/win] Always use absolute, canonicalized paths.
This ensures that on Windows we take advantage of 32k-character file name limit consistently for all files and directories operations.

TEST=ci
BUG=https://github.com/dart-lang/sdk/issues/56125
BUG=https://github.com/dart-lang/sdk/issues/55972
CoreLibraryReviewExempt: adds windows-specific error code for invalid file name
Change-Id: I83bd3ceac579e589469e47b2cf5216db457cae8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375421
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-08-15 17:51:10 +00:00
Brian Quinlan f753fe4144 Throw RedirectException when a redirect is missing a Location header
Bug:https://github.com/dart-lang/sdk/issues/53618,https://github.com/dart-lang/sdk/issues/53158
Change-Id: Ib7ea9503dd58c0d1c233a85d92d4feb0648a9022
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380380
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-08-14 18:17:59 +00:00
Alexander Aprelev b207aed8b7 [vm/file/win] Normalize absolute paths before adding long-prefix.
Long-prefixed paths can't have '..' segments in them.

Delete recursively uses long-prefixes, so the tests that verify long paths handling had to be updated accordingly: it's okay to use long paths when they are prefixed(when they are deleted recursively).

This is follow-up to https://github.com/dart-lang/sdk/commit/4928998ebe7d45ca27846af1e8cd4fd45cd475e3

Bug: https://github.com/dart-lang/sdk/issues/56125
Change-Id: I6613b1a324e8923d05e5f0a470ee5b2999d1b929
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374220
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-07-03 02:37:19 +00:00