Commit graph

615 commits

Author SHA1 Message Date
Patrik Nordwall
3efc1c2877
Disable Java serialization by default, #22333 (#27285)
* akka.actor.allow-java-serialization = off
* Moved primitive (Long, Int, String, ByteString) serializers
  from akka-remote to akka-actor since they had no dependency
  and are useful also in local systems, e.g. persistence.
  * e.g. needed for persistence-tck
  * less allow-java-serialization=on in tests
* CborSerializable in Jackson/test module for ease of use
* JavaSerializable for Java serialization in tests, already in akka-testkit,
  but misconfigured
* Made tests pass
  * allow-java-serialization=on in akka-persistence
  * allow-java-serialization=on in classic remoting tests
  * JavaSerializable and CborSerializable in other remoting tests
* Added serialization for
  * Boolean
  * java.util.concurrent.TimeoutException, AskTimeoutException
* support for testing serialization with the inmem journal
* utility to verifySerialization, in SerializationTestKit
* remove AccountExampleWithCommandHandlersInState becuase not possible to serialize State when it's not static
  * Effect() is factory in EventSourcedBehavior  class
* test the account examples
* SharedLeveldbJournal.configToEnableJavaSerializationForTest
* support for exceptions from remote deployed child actors
  * fallback to akka.remote.serialization.ThrowableNotSerializableException
    if exception is not serializable when wrapped in system messages from
    remote deployed child actors and Status.Failure messages
  * it's implemented in `WrappedPayloadSupport.payloadBuilder`
* update reference documentation
* serialize-messages=off in most places, separate ticket for
  improving or removing that feature
* migration guide, including description of rolling update

* fix 2.13 compiler error

* minor review feedback
2019-07-11 14:04:24 +02:00
Patrik Nordwall
f9d76aa030
Log Dropped from DeadLetterListener, #26432 (#27160)
* Log Dropped from DeadLetterListener, #26432

* Move Dropped from akka-actor-typed to akka-actor
* Use it in Artery
* Use in right way from GroupRouter, not via deadLetters
* Remove "without sender" in log message from DeadLetterListener,
  since there is no sender in Typed
* mima filter
* add sender to Dropped
2019-07-04 14:52:42 +02:00
Patrik Nordwall
50e99e08d8 Use short configurable timeout for expectNoMessage #27212 (#27213)
* Use short configurable timeout for expectNoMessage #27212

* consistent with ActorTestKit in Typed

* fix config
2019-06-26 15:35:20 +01:00
Patrik Nordwall
10d32fceb9 scheduleWithFixedDelay vs scheduleAtFixedRate, #26910
* previous `schedule` method is trying to maintain a fixed average frequency
  over time, but that can result in undesired bursts of scheduled tasks after a long
  GC or if the JVM process has been suspended, same with all other periodic
  scheduled message sending via various Timer APIs
* most of the time "fixed delay" is more desirable
* we can't just change because it's too big behavioral change and some might
  depend on previous behavior
* deprecate the old `schedule` and introduce new `scheduleWithFixedDelay`
  and `scheduleAtFixedRate`, when fixing the deprecation warning users should
  make a concious decision of which behavior to use (scheduleWithFixedDelay in
  most cases)

* Streams
* SchedulerSpec
  * test both fixed delay and fixed rate
* TimerSpec
* FSM and PersistentFSM
* mima
* runnable as second parameter list, also in typed.Scheduler
* IllegalStateException vs SchedulerException
* deprecated annotations
* api and reference docs, all places
* migration guide
2019-06-05 11:38:04 +02:00
Helena Edelson
9f19e4972b
Better indicator of ActorRefProvider implementation selection (#27012) 2019-05-29 12:01:02 -07:00
Christopher Batey
6754bf7f73 Remove JavaTestkit (#27022)
* Remove JavaTestKit

* mima

* Also remove Caching partial function

* Formatting

* Update akka-docs/src/main/paradox/project/migration-guide-2.5.x-2.6.x.md

Co-Authored-By: Arnout Engelen <github@bzzt.net>
2019-05-29 15:45:20 +02:00
Arnout Engelen
814cfa286c Scala 2.13.0 rc2 (#26967) 2019-05-24 08:11:50 +02:00
Dale Wijnand
03c4efdc1d Rewrite some code for Scala 2.13 (#26944)
* Rewrite some code for Scala 2.13

Rewrote some code to avoid some deprecations coming in 2.13.

* Drop usage of scala.Symbol in the tests
2019-05-20 08:59:49 +02:00
Martynas Mickevičius
2184a617a3 Drop MiMa filters for 2.4.x (#26781) 2019-04-23 09:24:29 +02:00
Arnout Engelen
7372d2b735
Fix remaining akka-testkit warnings (#26752)
* Fix remaining akka-testkit warnings

Mostly in tests and 2.13

* Add issue link

* MiMa exclude for multi-node-testkit

We don't promise bincompat there anyway, but perhaps good to keep mima there
so at least we don't break things accidentally
2019-04-16 18:33:38 +02:00
Helena Edelson
392b4baf20 Compiler warnings for actor-testkit #26708 (#26716) 2019-04-15 07:11:24 +00:00
Auto Format
75579bed17 format source with scalafmt, #26511 2019-03-15 10:23:46 +01:00
Auto Format
ce404e4f53 format source with scalafmt 2019-03-11 16:58:55 +01:00
Patrik Nordwall
5c96a5f556 replace unicode arrows
* ⇒, →, ←
* because we don't want to show them in documentation snippets and
  then it's complicated to avoid that when snippets are
  located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala
2019-03-11 16:58:51 +01:00
hepin1989
998c5a9285 Formatting java codes with sbt-java-formatter. 2019-01-12 04:00:53 +08:00
Arnout Engelen
d274e039f9
Various scala-2.13.0-M5 fixes
fix akka-actor-tests compile errors

some tests still fail though

Fix test failures in akka-actor-test

Manually work arround missing implicit Factory[Nothing, Seq[Nothing]]

see https://github.com/scala/scala-collection-compat/issues/137

akka-remote scalafix changes

Fix shutdownAll compile error

test:akka-remote scalafix changes

akka-multi-node-testkit scalafix

Fix akka-remote-tests multi-jvm compile errors

akka-stream-tests/test:scalafix

Fix test:akka-stream-tests

Crude implementation of ByteString.map

scalafix akka-actor-typed, akka-actor-typed-tests

akka-actor-typed-tests compile and succeed

scalafix akka-camel

scalafix akka-cluster

akka-cluster compile & test

scalafix akka-cluster-metrics

Fix akka-cluster-metrics

scalafix akka-cluster-tools

akka-cluster-tools compile and test

scalafix akka-distributed-data

akka-distributed-data fixes

scalafix akka-persistence

scalafix akka-cluster-sharding

fix akka-cluster-sharding

scalafix akka-contrib

Fix akka-cluster-sharding-typed test

scalafix akka-docs

Use scala-stm 0.9 (released for M5)

akka-docs

Remove dependency on collections-compat

Cherry-pick the relevant constructs to our own
private utils

Shorten 'scala.collections.immutable' by importing it

Duplicate 'immutable' imports

Use 'foreach' on futures

Replace MapLike with regular Map

Internal API markers

Simplify ccompat by moving PackageShared into object

Since we don't currently need to differentiate between 2.11 and

Avoid relying on 'union' (and ++) being left-biased

Fix akka-actor/doc by removing -Ywarn-unused

Make more things more private

Copyright headers

Use 'unsorted' to go from SortedSet to Set

Duplicate import

Use onComplete rather than failed.foreach

Clarify why we partly duplicate scala-collection-compat
2019-01-11 12:27:18 +01:00
Arnout Engelen
0cc8e20a2e
Various scala-2.13.0-M5 fixes
Clearer imports in TcpDnsClient

Accept SVG's when checking if diagrams were generated

Fix akka-actor MiMa issues

akka-testkit scalafix changes

Update scalatest to 2.13-released snapshot

akka-stream scalafix changes

Update ssl-config

To version that's released with -M5

Take elements directly out of buffer

Manually fix immutable.Seq / Doc link

Make sure the right Concat, Sink is imported

akka-stream binary compat

akka-stream-testkit scalafix

akka-actor-tests scalafix

Eta-expensions
2019-01-11 11:44:35 +01:00
Christopher Batey
f18399823a
Artery tests: use config to determine TCP/UDP free port + use the correct host (#26211)
* Harden RemoteConnectionSpec

* Select a free port on the same interface for the second actor system
rather than the random one

* Use config to determine tcp/udp for free port in Artery tests
2019-01-08 14:07:13 +00:00
kerr
bdc90052aa Update headers from 2018 to 2019 once for all. (#26165)
* Add CopyrightHeader support for sbt-boilerplate plugin.
* Add CopyrightHeader support for `*.proto` files.
* Add regex match for both `–` and `-` for CopyrightHeader.
* Add CopyrightHeader support for sbt build files.
* Update copyright from 2018 to 2019.
2019-01-02 11:55:26 +01:00
Helena Edelson
408fab3313
Fix compiler warnings in akka-remote, akka-actor-typed. (#26139)
Fix compiler warnings in akka-remote, akka-actor-typed. (#26139)
2018-12-20 09:10:54 -08:00
Helena Edelson
7e614a595f
Fix compiler warnings akka-actor (#26095)
[# 26089](https://github.com/akka/akka/issues/26089)
2018-12-14 17:48:08 -05:00
Christopher Batey
e5c1fc02a9
Support ClusterSharding passivation in BackoffSupervisor (#25933)
* Specific final stop message predicate instead of arbitrary action
2018-12-06 10:10:37 +00:00
Christopher Batey
69c58b3725
Harden AsyncDnsResolverIntegrationSpec (#25908)
* Harden AsyncDnsIntegrationSpec
* Ensure that the port is available on TCP and UDP
* Don't listen on ipv6 (fails on jenkins sometimes)
2018-12-05 11:35:10 +00:00
Christopher Batey
af38a1eefd
Harden NettyTransportSpec (#25500)
* Harden NettyTransportSpec

Keep the temporary port open while the ActorSystem is created so it
can't select the same port to bind on.

Fixes #25479
2018-12-04 15:59:54 +00:00
Philippus Baalman
90bf989630 Replace scalactic deprecations (#25886) 2018-11-09 09:07:21 +01:00
Dale Wijnand
6a04731971 Dilation cleanups (#25861)
* Avoid calling asInstanceOf in dilated

* Fix the rounding in dilated for Java

* Delegate Java dilated to Scala dilated

* Import scala.concurrent.duration.Duration
2018-11-05 09:55:40 +00:00
kerr
fafc59b19d update headers to regular comment (#25807) 2018-10-29 05:19:37 -04:00
Christopher Batey
ea454a733d Reset timeout for fixed restarts 2018-09-20 08:36:01 +01:00
Guy Youansi
eb5885e94e add java.time.Duration support for javadsl #24646
* add java.time.Duration support for askWithReplyto methods and add deprecated to method with akka Timeout as parameter type
2018-08-23 12:09:21 +02:00
Kazuhiro Sera
482eaea122 Fix several minor typos detected by github.com/client9/misspell (#25448)
* Fix several minor typos detected by github.com/client9/misspell

* Revert s/erminater/erminator/ in /ActorSystemSpec
2018-08-21 11:02:37 +09:00
kenji yoshida
5b3b191bac Remove procedure syntax (#25362) 2018-07-25 13:38:27 +02:00
Jimin Hsieh
7c3a8a8ed5 java.time.Duration APIs in javadsl.TestKit #24646 2018-05-29 12:17:48 +02:00
Mirco Dotta
2722cf8c6b EventFilter.error filters all errors regardless of the cause, #25057 (#25125) 2018-05-22 13:54:56 +02:00
Guy Youansi
759010f0cd +act add java.time.Duration support Actor javadsl (#24993)
* add java support in akka-actor module in the class Abstract.ActorContext by adding the setReceiveTimeout and CancelReceiveTimeout

* add akka.actor.AbstractActor#ActorContext cancelReceiveTimeout and setReceiveTimeout to mima-excludes file

* removed scala.concurrent.duration dependency in ActorDocTest and add new method expectTerminated with java.time.Duration support in TestKit

* used java.time.Duration as default import
2018-05-14 17:22:02 +09:00
Sebastien Coquelin
e5cdf9824c Introduced new awaitAssert methods accepting java.time.Duration parameters 2018-05-07 10:47:06 -04:00
Konrad `ktoso` Malawski
0f676cb6f1
use travis for mima and whitesource, remain no jenkins for tests (in parallel) (#24968)
* travis config from akka-http

* amend CONTRIBUTING to explain our tests

* amend wording in CONTRIBUTING

* new whitesource key

* remove instead of comment deployment things

* Update CONTRIBUTING.md

* exclude new module in 2.5 from appearing in 2.4 previous mima artifacts

* fix mima on 2.12
2018-04-24 22:58:54 +09:00
虎鸣
e45a638ce0 + testkit Add java.time.Duration to testkit's javadsl 2018-03-20 22:39:30 +08:00
Jimin Hsieh
2c2b8ba001 Remove some of Unused import warning (#24650) 2018-03-16 12:08:29 +01:00
Yoshimasa Tanabe
a878e6c9fa Adding explanation for Java DSL TestKit#awaitAssert return value (#24110) (#24737) 2018-03-16 11:41:18 +01:00
Konrad `ktoso` Malawski
563c7fbcf0 Issue 24594: Integration with sbt-headers and initial header population 2018-03-13 15:45:55 +01:00
Johan Andrén
fd6f30673a Actually use the relative blocking io dispatcher setting #24357
* Remove docs and have only deprecation comment on old setting
* ConfigFactory.load fixed
2018-02-22 13:42:59 +01:00
Patrik Nordwall
0d222906f4 Prepare Artery for alternative TCP transport, #24390
* Refactoring to separate the Aeron specific things, ArteryAeronUdpTransport
* move Aeron specific classes to akka.remote.artery.aeron package
* move Version to ArterySettings, and describe strategy for envelope header changes
2018-02-20 16:02:57 +01:00
Christopher Batey
eb1f2a675e Java DSL for typed persistent actors, #24193
* Basic working java api

* Most of the compile only spec in java

* Bits and bobs

* Abstract class for java dsl

* Move to using an abstract class for java dsl

* Wip, playing with not needed classes

* Docs ported to java and removal of the class objects

* java docs for recovery and tagging
2018-02-02 17:53:27 +01:00
Christopher Batey
6c7839f937 Testkit docs use deprecated messages (#24472)
We also had a deprecated method without implementing
the alternative
2018-02-02 18:12:01 +09:00
Johannes Rudolph
f1aa12daf2 Port WithLogCapturing + Silence TLSSpec (#24476)
* =tkt port WithLogCapturing from akka-http

* =str use WithLogCapturing for very noisy TLSSpec

* =sha use WithLogCapturing to silence noisy CoordinatedShutdownShardingSpec
2018-02-02 09:50:28 +09:00
Arnout Engelen
fe5a42586c Scheduler that manually advances time (##24150)
* Don't apply dilation to scheduler parameter
* Clarify ExecutionContext usage
* Clarify comment on timePasses
* Make ExplicitlyTriggeredScheduler internals private
* List currently scheduled tasks in one log message
* Execute immediately if (initialDelay <= Duration.Zero)
* Don't reschedule if scheduled task fails
* Be more efficient about logging
* Widen `timePasses` delay for now
https://github.com/akka/akka/pull/24243#discussion_r160985493 for some
discussion on what to do instead
* Remove mechanism for mixing in config from a test trait
2018-01-31 14:48:05 +01:00
Arnout Engelen
ed9ece49c4 Use expectNoMessage in typed testkit (#24250)
* Use expectNoMessage in typed testkit

Interestingly most calls to expectNoMsg did not appear to expect the parameter
to be dilated

Might be nice to allow configuring a variant that uses a (configurable) default
delay (other than the single-expect-default)

* Add a probe.expectNoMessage with no parameters

If you want to 'just wait a while' and not care too much about how long
exactly, will be dilated.
2018-01-15 15:08:18 +01:00
Konrad `ktoso` Malawski
be7c05cad2
=tes #24270 expectNoMessage should pull the unexpected msg (#24271)
* =tes #24270 expectNoMessage should pull the unexpected msg from the queue

* Update TestKit.scala
2018-01-09 20:35:43 +09:00
Christopher Batey
009214ae07
Update copyright to 2018 (#24241) 2018-01-04 17:26:29 +00:00
Patrik Nordwall
768753556b Fix shutdown timeout in multi-jvm tests, #23925 (#23927) 2017-11-06 13:31:51 +01:00