Liking cljdoc? Tell your friends :D

jepsen.generator.test

This namespace contains functions for testing generators. See the jepsen.generator-test namespace in the test/ directory for a concrete example of how these functions can be used.

NOTE: While the simulate function is considered stable at this point, the others might still be subject to change -- use with care and expect possible breakage in future releases.

This namespace contains functions for testing generators. See the
`jepsen.generator-test` namespace in the `test/` directory for a concrete
example of how these functions can be used.

NOTE: While the `simulate` function is considered stable at this point, the
others might still be subject to change -- use with care and expect possible
breakage in future releases.
raw docstring

default-contextclj

A default initial context for running these tests. Two worker threads, one nemesis.

A default initial context for running these tests. Two worker threads, one
nemesis.
raw docstring

default-testclj

A default test map.

A default test map.
raw docstring

imperfectclj

(imperfect gen)
(imperfect ctx gen)

Simulates the series of ops obtained from a generator where threads alternately fail, info, then ok, and repeat, taking 10 ns each. Returns invocations and completions.

Simulates the series of ops obtained from a generator where threads
alternately fail, info, then ok, and repeat, taking 10 ns each. Returns
invocations and completions.
raw docstring

invocationsclj

(invocations history)

Only invokes, not returns

Only invokes, not returns
raw docstring

n+nemesis-contextclj

(n+nemesis-context n)

A context with n numeric worker threads and one nemesis.

A context with n numeric worker threads and one nemesis.
raw docstring

perfectclj

(perfect gen)
(perfect ctx gen)

Simulates the series of ops obtained from a generator where the system executes every operation successfully in 10 nanoseconds. Returns only invocations.

Simulates the series of ops obtained from a generator where the system
executes every operation successfully in 10 nanoseconds. Returns only
invocations.
raw docstring

perfect*clj

(perfect* gen)
(perfect* ctx gen)

Simulates the series of ops obtained from a generator where the system executes every operation successfully in 10 nanoseconds. Returns full history.

Simulates the series of ops obtained from a generator where the system
executes every operation successfully in 10 nanoseconds. Returns full
history.
raw docstring

perfect-infoclj

(perfect-info gen)
(perfect-info ctx gen)

Simulates the series of ops obtained from a generator where every operation crashes with :info in 10 nanoseconds. Returns only invocations.

Simulates the series of ops obtained from a generator where every operation
crashes with :info in 10 nanoseconds. Returns only invocations.
raw docstring

perfect-latencyclj

How long perfect operations take

How long perfect operations take
raw docstring

quickclj

(quick gen)
(quick ctx gen)

Like quick-ops, but returns just invocations.

Like quick-ops, but returns just invocations.
raw docstring

quick-opsclj

(quick-ops gen)
(quick-ops ctx gen)

Simulates the series of ops obtained from a generator where the system executes every operation perfectly, immediately, and with zero latency.

Simulates the series of ops obtained from a generator where the
system executes every operation perfectly, immediately, and with zero
latency.
raw docstring

rand-seedclj

We need tests to be deterministic for reproducibility, but also pseudorandom. Changing this seed will force rewriting some tests, but it might be necessary for discovering edge cases.

We need tests to be deterministic for reproducibility, but also
pseudorandom. Changing this seed will force rewriting some tests, but it
might be necessary for discovering edge cases.
raw docstring

simulateclj

(simulate gen complete-fn)
(simulate ctx gen complete-fn)

Simulates the series of operations obtained from a generator, given a function that takes a context and op and returns the completion for that op.

Strips out op :index fields--it's generally not as useful for testing.

Simulates the series of operations obtained from a generator, given a
function that takes a context and op and returns the completion for that op.

Strips out op :index fields--it's generally not as useful for testing.
raw docstring

with-fixed-randscljmacro

(with-fixed-rands seed & body)

Rebinds rand, rand-int, and rand-nth to yield a deterministic series of random values. Definitely not threadsafe, but fine for tests I think.

Rebinds rand, rand-int, and rand-nth to yield a deterministic series of
random values. Definitely not threadsafe, but fine for tests I think.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close