TestContext

cats.effect.kernel.testkit.TestContext$
See theTestContext companion class

Attributes

Companion:
class
Source:
TestContext.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

final class ConcurrentState(val currentID: AtomicLong, val currentNanos: AtomicLong, val tasks: ConcurrentSkipListSet[Task], val lastReportedFailure: AtomicReference[Throwable])

Attributes

Source:
TestContext.scala
Graph
Supertypes
class Object
trait Matchable
class Any
final case class State(lastID: Long, clock: FiniteDuration, tasks: SortedSet[Task], lastReportedFailure: Option[Throwable])

Used internally by TestContext, represents the internal state used for task scheduling and execution.

Used internally by TestContext, represents the internal state used for task scheduling and execution.

Attributes

Source:
TestContext.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
final case class Task(id: Long, task: Runnable, runsAt: FiniteDuration, rnd: Long)

Used internally by TestContext, represents a unit of work pending execution.

Used internally by TestContext, represents a unit of work pending execution.

Attributes

Source:
TestContext.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

Builder for TestContext instances. Utilizes a random seed, which may be obtained from the TestContext#seed method.

Builder for TestContext instances. Utilizes a random seed, which may be obtained from the TestContext#seed method.

Attributes

Source:
TestContext.scala

Constructs a new TestContext using the given seed, which must be encoded as base64. Assuming this seed was produced by another TestContext, running the same program against the new context will result in the exact same task interleaving as happened in the previous context, provided that the same tasks are interleaved. Note that subtle differences between different runs of identical programs are possible, particularly if one program auto-cedes in a different place than the other one. This is an excellent and reliable mechanism for small, tightly-controlled programs with entirely deterministic side-effects, and a completely useless mechanism for anything where the scheduler ticks see different task lists despite identical configuration.

Constructs a new TestContext using the given seed, which must be encoded as base64. Assuming this seed was produced by another TestContext, running the same program against the new context will result in the exact same task interleaving as happened in the previous context, provided that the same tasks are interleaved. Note that subtle differences between different runs of identical programs are possible, particularly if one program auto-cedes in a different place than the other one. This is an excellent and reliable mechanism for small, tightly-controlled programs with entirely deterministic side-effects, and a completely useless mechanism for anything where the scheduler ticks see different task lists despite identical configuration.

Attributes

Source:
TestContext.scala