Search Results for

    Show / Hide Table of Contents

    Class TestConductor

    The conductor is the one orchestrating the test: it governs the Akka.Remote.TestKit.Controller's ports to which all Players connect, it issues commands to their FailureInjectorTransportAdapter and provides support for barriers using the Akka.Remote.TestKit.BarrierCoordinator. All of this is bundled inside the TestConductor

    Inheritance
    object
    TestConductor
    Implements
    IExtension
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Remote.TestKit
    Assembly: Akka.Remote.TestKit.dll
    Syntax
    public class TestConductor : IExtension

    Constructors

    | Edit this page View Source

    TestConductor(ActorSystem)

    Declaration
    public TestConductor(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system

    Properties

    | Edit this page View Source

    Address

    Transport address of this Helios-like remote transport.

    Declaration
    public Address Address { get; }
    Property Value
    Type Description
    Address
    | Edit this page View Source

    Client

    Declaration
    public IActorRef Client { get; }
    Property Value
    Type Description
    IActorRef
    | Edit this page View Source

    Controller

    Declaration
    public IActorRef Controller { get; }
    Property Value
    Type Description
    IActorRef
    | Edit this page View Source

    Settings

    Declaration
    public TestConductorSettings Settings { get; }
    Property Value
    Type Description
    TestConductorSettings
    | Edit this page View Source

    Transport

    Remote transport used by the actor ref provider.

    Declaration
    public RemoteTransport Transport { get; }
    Property Value
    Type Description
    RemoteTransport

    Methods

    | Edit this page View Source

    Abort(RoleName, RoleName)

    Tell the remote support to TCP_RESET the connection to the given remote peer. It works regardless of whether the recipient was initiator or responder.

    Declaration
    public Task<Done> Abort(RoleName node, RoleName target)
    Parameters
    Type Name Description
    RoleName node

    is the symbolic name of the node which is to be affected

    RoleName target

    is the symbolic name of the other node to which connectivity shall be impeded

    Returns
    Type Description
    Task<Done>
    | Edit this page View Source

    Blackhole(RoleName, RoleName, Direction)

    Switch the helios pipeline of the remote support into blackhole mode for sending and/or receiving: it will just drop all messages right before submitting them to the Socket or right after receiving them from the Socket.

    ====Note==== To use this feature you must activate the failure injector and throttler transport adapters by specifying testTransport(on = true) in your MultiNodeConfig.

    Declaration
    public Task<Done> Blackhole(RoleName node, RoleName target, ThrottleTransportAdapter.Direction direction)
    Parameters
    Type Name Description
    RoleName node

    is the symbolic name of the node which is to be affected

    RoleName target

    is the symbolic name of the other node to which connectivity shall be impeded

    ThrottleTransportAdapter.Direction direction

    can be either Direction.Send, Direction.Receive or Direction.Both

    Returns
    Type Description
    Task<Done>
    | Edit this page View Source

    Disconnect(RoleName, RoleName)

    Tell the remote support to TCP_RESET the connection to the given remote peer. It works regardless of whether the recipient was initiator or responder.

    Declaration
    public Task<Done> Disconnect(RoleName node, RoleName target)
    Parameters
    Type Name Description
    RoleName node

    is the symbolic name of the node which is to be affected

    RoleName target

    is the symbolic name of the other node to which connectivity shall be impeded

    Returns
    Type Description
    Task<Done>
    | Edit this page View Source

    Enter(RoleName, string)

    Enter the named barriers, one after the other, in the order given. Will throw an exception in case of timeouts or other errors.

    Declaration
    public void Enter(RoleName roleName, string name)
    Parameters
    Type Name Description
    RoleName roleName
    string name
    | Edit this page View Source

    Enter(TimeSpan, RoleName, ImmutableList<string>)

    Enter the named barriers, one after the other, in the order given. Will throw an exception in case of timeouts or other errors.

    Declaration
    public void Enter(TimeSpan timeout, RoleName roleName, ImmutableList<string> names)
    Parameters
    Type Name Description
    TimeSpan timeout
    RoleName roleName
    ImmutableList<string> names
    | Edit this page View Source

    Exit(RoleName, int)

    Tell the actor system at the remote node to shut itself down. The node will also be removed, so that the remaining nodes may still pass subsequent barriers.

    Declaration
    public Task<Done> Exit(RoleName node, int exitValue)
    Parameters
    Type Name Description
    RoleName node

    is the symbolic name of the node which is to be affected

    int exitValue

    is the return code which shall be given to System.exit

    Returns
    Type Description
    Task<Done>

    TBD

    Exceptions
    Type Condition
    InvalidOperationException

    TBD

    | Edit this page View Source

    Get(ActorSystem)

    Declaration
    public static TestConductor Get(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system
    Returns
    Type Description
    TestConductor
    | Edit this page View Source

    GetAddressFor(RoleName)

    Declaration
    public Task<Address> GetAddressFor(RoleName name)
    Parameters
    Type Name Description
    RoleName name
    Returns
    Type Description
    Task<Address>
    | Edit this page View Source

    GetNodes()

    Obtain the list of remote host names currently registered.

    Declaration
    public Task<IEnumerable<RoleName>> GetNodes()
    Returns
    Type Description
    Task<IEnumerable<RoleName>>
    | Edit this page View Source

    PassThrough(RoleName, RoleName, Direction)

    Switch the Helios pipeline of the remote support into pass through mode for sending and/or receiving.

    ====Note==== To use this feature you must activate the failure injector and throttler transport adapters by specifying testTransport(on = true) in your MultiNodeConfig.

    Declaration
    public Task<Done> PassThrough(RoleName node, RoleName target, ThrottleTransportAdapter.Direction direction)
    Parameters
    Type Name Description
    RoleName node

    is the symbolic name of the node which is to be affected

    RoleName target

    is the symbolic name of the other node to which connectivity shall be impeded

    ThrottleTransportAdapter.Direction direction

    can be either Direction.Send, Direction.Receive or Direction.Both

    Returns
    Type Description
    Task<Done>
    | Edit this page View Source

    RemoveNode(RoleName)

    Remove a remote host from the list, so that the remaining nodes may still pass subsequent barriers. This must be done before the client connection breaks down in order to affect an "orderly" removal (i.e. without failing present and future barriers).

    Declaration
    public Task<Done> RemoveNode(RoleName node)
    Parameters
    Type Name Description
    RoleName node

    is the symbolic name of the node which is to be removed

    Returns
    Type Description
    Task<Done>
    | Edit this page View Source

    Shutdown(RoleName, bool)

    Tell the actor system at the remote node to shut itself down without awaiting termination of remote-deployed children. The node will also be removed, so that the remaining nodes may still pass subsequent barriers.

    Declaration
    public Task<Done> Shutdown(RoleName node, bool abort = false)
    Parameters
    Type Name Description
    RoleName node

    is the symbolic name of the node which is to be affected

    bool abort

    TBD

    Returns
    Type Description
    Task<Done>

    TBD

    Exceptions
    Type Condition
    InvalidOperationException

    TBD

    | Edit this page View Source

    StartClient(RoleName, IPEndPoint)

    Connect to the conductor on the given port (the host is taken from setting akka.testconductor.host). The connection is made asynchronously, but you should await completion of the returned Future because that implies that all expected participants of this test have successfully connected (i.e. this is a first barrier in itself). The number of expected participants is set in TestConductor.startController().

    Declaration
    public Task<Done> StartClient(RoleName name, IPEndPoint controllerAddr)
    Parameters
    Type Name Description
    RoleName name
    IPEndPoint controllerAddr
    Returns
    Type Description
    Task<Done>
    | Edit this page View Source

    StartController(int, RoleName, IPEndPoint)

    Start the Controller, which in turn will bind to a TCP port as specified in the akka.testconductor.port config property, where 0 denotes automatic allocation. Since the latter is actually preferred, a Future[Int] is returned which will be completed with the port number actually chosen, so that this can then be communicated to the players for their proper start-up.

    This method also invokes Player.startClient, since it is expected that the conductor participates in barriers for overall coordination. The returned Future will only be completed once the client’s start-up finishes, which in fact waits for all other players to connect.

    Declaration
    public Task<IPEndPoint> StartController(int participants, RoleName name, IPEndPoint controllerPort)
    Parameters
    Type Name Description
    int participants

    participants gives the number of participants which shall connect before any of their startClient() operations complete

    RoleName name
    IPEndPoint controllerPort
    Returns
    Type Description
    Task<IPEndPoint>
    | Edit this page View Source

    Throttle(RoleName, RoleName, Direction, float)

    Make the remoting pipeline on the node throttle data sent to or received from the given remote peer. Throttling works by delaying packet submission within the netty pipeline until the packet would have been completely sent according to the given rate, the previous packet completion and the current packet length. In case of large packets they are split up if the calculated end pause would exceed akka.testconductor.packet-split-threshold (roughly). All of this uses the system’s scheduler, which is not terribly precise and will execute tasks later than they are schedule (even on average), but that is countered by using the actual execution time for determining how much to send, leading to the correct output rate, but with increased latency.

    ====Note==== To use this feature you must activate the failure injector and throttler transport adapters by specifying testTransport(on = true) in your MultiNodeConfig.

    Declaration
    public Task<Done> Throttle(RoleName node, RoleName target, ThrottleTransportAdapter.Direction direction, float rateMBit)
    Parameters
    Type Name Description
    RoleName node

    is the symbolic name of the node which is to be affected

    RoleName target

    is the symbolic name of the other node to which connectivity shall be throttled

    ThrottleTransportAdapter.Direction direction

    can be either Direction.Send, Direction.Receive or Direction.Both

    float rateMBit

    is the maximum data rate in MBit

    Returns
    Type Description
    Task<Done>

    Implements

    IExtension

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET