Timeout class final

A class representing a modification to the default timeout for a test.

By default, a test will time out after 30 seconds. With Timeout, that can be overridden entirely; with Timeout.factor, it can be scaled relative to the default.

Annotations
  • @Target({TargetKind.library})

Constructors

Timeout(Duration? duration)
Declares an absolute timeout that overrides the default.
const
Timeout.factor(num? scaleFactor)
Declares a relative timeout that scales the default.
const
Timeout.parse(String timeout)
Parse the timeout from a user-provided string.
factory

Properties

duration Duration?
The timeout duration.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleFactor num?
The timeout factor.
final

Methods

apply(Duration base) Duration?
Returns a new Duration from applying this to base.
merge(Timeout other) Timeout
Returns a new Timeout that merges this with other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Constants

none → const Timeout
A constant indicating that a test should never time out.