ex_unit_clustered_case v0.3.1 ExUnit.ClusteredCase.Node

This module handles starting new nodes

You can specify various options when starting a node:

  • :name, takes either a string or an atom, in either long or short form, this sets the node name and id.
  • :boot_timeout, specifies the amount of time to wait for a node to perform it’s initial boot sequence before timing out
  • :init_timeout, specifies the amount of time to wait for the node agent to complete initializing the node (loading and starting required applications, applying configuration, loading test modules, and executing post-start functions)
  • :erl_flags, a list of arguments to pass to erl when starting the node, e.g. ["-init_debug"]
  • :env, a list of tuples containing environment variables to export in the node’s environment, e.g. [{"PORT", "8080"}]
  • :config, a Keyword list containing configuration overrides to apply to the node, should be in the form of [app: [key: value]]
  • :post_start_functions, a list of functions, either captured or in {module, function, args} format, which will be invoked on the node after it is booted and initialized. Functions must be zero-arity.

Link to this section Summary

Link to this section Types

Link to this type fun()
fun() :: (() -> term()) | {module(), atom(), [term()]}
Link to this type node_error()
node_error() ::
  :already_started
  | :started_not_connected
  | :boot_timeout
  | :init_timeout
  | :not_alive
Link to this type node_opt()
node_opt() ::
  {:name, String.t() | atom()}
  | {:boot_timeout, pos_integer()}
  | {:init_timeout, pos_integer()}
  | {:erl_flags, [String.t()]}
  | {:env, [{String.t(), String.t()}]}
  | {:config, Keyword.t()}
  | {:post_start_functions, [(... -> any())]}
Link to this type node_opts()
node_opts() :: [node_opt()]