Commit Graph

580 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
ab45cab941 [Distributed] Skip availability checks, checking if distributed is available is enough (#39899) 2021-10-26 10:38:34 +09:00
Kavon Farvardin
f8fb279442 improve robustness of dist actor test
We were seeing flaky runs due to the hard-to-determine order and point at which
the actor instances were being deallocated in the old version of the test. In addition,
all of the actor addresses were the same, so moving the point of deallocation would
give us a less rigorous test.

This patch puts all of the instances in an array so that we can rely on CHECK-DAG
to check for the deallocations in any order, as a group at the end of the test. The
deallocations are now identifiable using a simple counter for the addresses.

resolves rdar://84574311
2021-10-25 13:50:42 -07:00
Kuba (Brecka) Mracek
38e9f3960a Temporarily disable distributed_actor_init_local.swift test because it's flaky (#39894) 2021-10-24 16:08:37 +09:00
Konrad `ktoso` Malawski
495b020b79 [Windows/Distributed] Disable failing test (#39890)
* [Windows/Distributed] Disable failing test

* Mark windows unsupported instead of xfail
2021-10-24 12:03:50 +09:00
Arnold Schwaighofer
54319d774a Mark distributed_actor_default_init/deinit tests as requiring macOS
They currently block PR testing.
2021-10-23 10:50:22 -07:00
Konrad `ktoso` Malawski
39fa0d7464 [Distributed] be more explicit about DA being Sendable 2021-10-23 19:41:58 +09:00
Kavon Farvardin
191c996d7e fix whitespace in check line for Linux 2021-10-22 10:10:25 -07:00
Kavon Farvardin
9a76323b83 throwing sync inits are also not fully working 2021-10-21 21:14:22 -07:00
Kavon Farvardin
f75a6e94e4 capture the known problem with multiple actorReady calls in async inits
We haven't yet integrated more deeply into DI to prevent the multiple calls.
2021-10-21 19:41:31 -07:00
Kavon Farvardin
e545557dee remove redundant defers, now that actorReady is called implicitly 2021-10-21 19:41:31 -07:00
Kavon Farvardin
efe8f5ded6 add SIL coverage for current actorReady and resignIdentity calls 2021-10-21 19:41:31 -07:00
Kavon Farvardin
bdd8766909 Move the few SIL tests under the Distributed directory
Basically turn test/SIL/Distributed into test/Distributed/SIL

Since we have typechecking and runtime tests under there already,
and there are only a handful of distributed-actor specific SIL tests.
2021-10-21 19:41:31 -07:00
Kavon Farvardin
cc1ae9f931 merge coverage of multiple transport args into a runtime test
the SIL test for ensuring that the transport argument is chosen correctly can
also be covered by a runtime test. It also gives me an excuse to add some
async init coverage too.
2021-10-21 19:41:31 -07:00
swift-ci
e2c3089475 Merge pull request #39862 from apple/wip-speedup-test 2021-10-21 17:42:48 -07:00
Konrad `ktoso` Malawski
407bd539c9 [Distributed] speed-up test StdlibUnittest 2021-10-22 07:14:20 +09:00
Konrad `ktoso` Malawski
630190962f avoid unnecessary @available checks 2021-10-22 07:13:33 +09:00
Konrad `ktoso` Malawski
c8b4e8ea17 [Distributed] More tests for local actor init, with specific transport type (#39788) 2021-10-20 06:39:23 +09:00
Konrad `ktoso` Malawski
19ab0a18ad [Codable] Improve diagnosis of empty enum Codable synthesis failure (#39795)
* [Codable] Improve diagnosis of empty enum Codable synthesis failure

* a few more tests got extra warnings now
2021-10-18 11:57:50 +09:00
Konrad `ktoso` Malawski
480bb082a9 [Distributed] Naive impl of whenLocal for distributed actors (#39654)
* [Distributed] Hacky impl of whenLocal for distributed actors

* cleanup & fix one test

* disable test on windows
2021-10-10 12:44:57 +09:00
Konrad `ktoso` Malawski
d5a2344882 [Distributed] Disable distributed_actor_local on windows 2021-10-05 08:00:58 +09:00
Konrad `ktoso` Malawski
b63774f954 [Distributed] disable a few runtime tests on windows for now
don't care about SPECIFIC order of deinits
2021-10-05 06:31:50 +09:00
Konrad `ktoso` Malawski
14c432c11d cleanup 2021-10-05 06:31:50 +09:00
Konrad `ktoso` Malawski
d4df6a3e65 [Distributed] Re-enable runtime tests 2021-10-05 06:31:49 +09:00
Doug Gregor
6f0e70a44d Unify 'distributed' checking for accesses to distributed actors.
Unify the logic for checking and marking accesses as
async/throws/uses-distributed-thunk to reduce the overall amount of
code, clarify the isolated/local/potentially-remote cases, and
consistently set these options. There are tiny semantic improvements
here where, e.g., one can asynchronously use non-distributed
functions, properties, and subscripts if we're in a context where we
know the actor is not remote.
2021-10-02 00:13:49 -07:00
Doug Gregor
147b2e9c15 Don't mark calls to async methods of distributed actors implicitly-async 2021-10-01 23:26:51 -07:00
Doug Gregor
62b2054aa1 Remove @_distributedActorIndependent attribute entirely.
All its uses have been subsumed into `nonisolated`.
2021-10-01 23:08:22 -07:00
Doug Gregor
d04fff6f12 A @_distributedActorIndependent declaration is nonisolated.
The `@__distributedActorIndependent` attribute is effectively the same
as nonisolated, so start treating it that way by making actor-isolation
checking look for it specifically and conclude "nonisolated". Remove
various special cases for this attribute that don't need to exist.
2021-10-01 22:43:50 -07:00
Doug Gregor
7e2469fe87 Remove unnecessary 'distributed' checks in actor isolation code.
Remove a few places where we are introducing extra distributed-related
actor isolation checking that either isn't necesssary or is incorrect.
Specifically:

* Hopping to a global actor *from* a distributed-actor isolated context
does not go through a distributed thunk (global actors can't have one).
* "Unrestricted" declarations are always unrestricted, so we don't
need an extra distributed check here (it won't ever occur).
* Actor isolation computation doesn't need a special case for
distributed; it marks too much, overriding (e.g.) global actor
isolation.

The primary semantic change visible here is that distributed actors
can now have truly 'nonisolated' members. They aren't required to be
'distributed' because they can't touch state anyway.
2021-10-01 21:59:48 -07:00
Konrad `ktoso` Malawski
bf0681d463 distributed thunk flag 2021-10-02 10:28:38 +09:00
Konrad `ktoso` Malawski
ebdb0610b9 [Distributed] Fix when a distributed thunk is invoked, unlock tests 2021-10-02 00:47:30 +09:00
Konrad `ktoso` Malawski
e133dadc0f [Distributed] Implement isolation check aware of Task/Task.detached etc 2021-10-01 12:20:41 +09:00
Konrad `ktoso` Malawski
a9dc94810f [Distributed] calls on self should not call the dist thunk 2021-09-30 22:48:06 +09:00
Slava Pestov
c8f3476f19 Don't use back-quotes in diagnostics 2021-09-15 18:38:34 -04:00
Kavon Farvardin
20271cbad5 Mark test as unsupported on windows to unblock CI
This is a temporary measure tracked by rdar://82593574
2021-08-31 13:25:40 -07:00
Konrad `ktoso` Malawski
d76690ef58 [Distributed] improve getting _remote funcs; cache gets 2021-08-30 21:50:49 +09:00
Konrad `ktoso` Malawski
77635280c2 [Distributed] Harden distributed_actor_deinit.swift 2021-08-29 21:02:09 +09:00
Konrad `ktoso` Malawski
c868bdd9f1 [Distributed] resolve synthesis via DerivedConformanceDistributedActor <3 2021-08-27 06:21:34 +09:00
Konrad `ktoso` Malawski
e408fa9722 [Distributed] unlock distributed_actor_deinit test again 2021-08-26 18:27:11 +09:00
Konrad `ktoso` Malawski
90d8816dee [Distributed] Move property synthesis to DerivedConformanceDistributedActor 2021-08-26 18:27:11 +09:00
Konrad `ktoso` Malawski
ee43ea827a [Distributed] fix AnyActorIdentity equality impl 2021-08-24 19:27:47 +09:00
Konrad `ktoso` Malawski
c916c0a394 [Distributed] decode init for DistributedActor (#38998)
* Revert "Revert "Merge pull request #38938 from drexin/wip-dist-resolve" (#38994)"

This reverts commit f6ae9f3387.

* [Distributed] decode init for DistributedActor
2021-08-24 17:00:58 +09:00
Dario Rexin
d43ea45b6a Revert "Revert "Merge pull request #38938 from drexin/wip-dist-resolve" (#38994)" (#39011)
This reverts commit f6ae9f3387.
2021-08-24 13:33:37 +09:00
Konrad `ktoso` Malawski
f6ae9f3387 Revert "Merge pull request #38938 from drexin/wip-dist-resolve" (#38994)
This reverts commit a4f3f2fb48, reversing
changes made to 8cf6c2e71b.
2021-08-23 20:30:41 +09:00
Konrad `ktoso` Malawski
beaf8a3203 Revert "[Distributed] Ensure _remote funcs synthesized before dynamic replacement (#38974)"
This reverts commit fe4ba18bf7.
2021-08-23 13:23:39 +09:00
Konrad `ktoso` Malawski
fe4ba18bf7 [Distributed] Ensure _remote funcs synthesized before dynamic replacement (#38974)
* [Distributed] Ensure _remote funcs synthesized before dynamic replacement

* cleanup

* remove redundant synthesis cause
2021-08-23 11:40:12 +09:00
Dario Rexin
3161d8f66c [Distributed] Generate SIL for DistributedActor.resolve
rdar://78484431
2021-08-19 17:32:00 -07:00
swift-ci
1e5dc45cb7 Merge pull request #38889 from ktoso/wip-distributed-only-exp 2021-08-16 18:11:36 -07:00
Konrad `ktoso` Malawski
fbd66e2b87 [Distributed] Only parse distributed when experimentla mode enabled 2021-08-16 18:11:06 +09:00
Konrad `ktoso` Malawski
4e8ca79072 [Distributed] deinit aware of remote "properties" (lack thereof in storage) 2021-08-13 19:43:53 +09:00
Konrad `ktoso` Malawski
ad346ae7f4 [Distributed] re-disable distributed/runtime tests to land initial work 2021-08-12 17:28:03 +09:00