Liking cljdoc? Tell your friends :D

jepsen.antithesis

Provides support for running Jepsen tests in Antithesis. Provides an RNG, lifecycle hooks, and assertions.

Randomness

You should wrap your entire program in (with-rng ...). This does nothing in ordinary environments, but in Antithesis, it replaces the jepsen.random RNG with one powered by Antithesis.

Lifecycle

Call setup-complete! once the test is ready to begin--for instance, at the end of Client/setup. Call event! to signal interesting things have happened.

Assertions

Assertions begin with assert-, and take an expression, a message, and data to include if the assertion fails. For instance:

(assert-always! (not (db-corrupted?)) "DB corrupted" {:db "foo"})

Wrappers

Wrap your test map in (a/test test-map). This wraps both the client and checkers with Antithesis instrumentation. You can also do this selectively using checker and client.

Provides support for running Jepsen tests in Antithesis. Provides an RNG,
lifecycle hooks, and assertions.

## Randomness

You should wrap your entire program in `(with-rng ...)`. This does nothing in
ordinary environments, but in Antithesis, it replaces the jepsen.random RNG
with one powered by Antithesis.

## Lifecycle

Call `setup-complete!` once the test is ready to begin--for instance, at the
end of Client/setup. Call `event!` to signal interesting things have
happened.

## Assertions

Assertions begin with `assert-`, and take an expression, a message, and data
to include if the assertion fails. For instance:

  (assert-always! (not (db-corrupted?)) "DB corrupted" {:db "foo"})

## Wrappers

Wrap your test map in `(a/test test-map)`. This wraps both the client and
checkers with Antithesis instrumentation. You can also do this selectively
using `checker` and `client`.
raw docstring

jepsen.antithesis.composer

Antithesis' Test Composer drives Jepsen by calling shell scripts, which communicate with the test via a control directory full of FIFOs. Each FIFO represents a single test composer action. They work like this:

  1. Test composer calls a script to do something.
  2. Script creates a fifo like /run/jepsen/op-1234, and blocks on it.
  3. Jepsen, watching /run/jepsen, detects the new fifo
  4. Jepsen fires off an invocation
  5. The operation completes
  6. Jepsen writes the results of the operation to /run/jepsen/invoke_1234
  7. Jepsen closes the FIFO
  8. The shell script prints the results out and exits
  9. The test composer receives the results

The types of commands are:

  • op-123: Runs a single operation from the generator
  • check: Wraps up the test's :generator, runs :final-generator, and checks the history.

This namespace provides the Jepsen-side infrastructure for watching the FIFO directory, a test runner like jepsen.core/run!, and a CLI command called antithesis which works like test, but uses our runner instead.

Antithesis' Test Composer drives Jepsen by calling shell scripts, which
communicate with the test via a control directory full of FIFOs. Each FIFO
represents a single test composer action. They work like this:

1. Test composer calls a script to do something.
2. Script creates a fifo like /run/jepsen/op-1234, and blocks on it.
3. Jepsen, watching /run/jepsen, detects the new fifo
4. Jepsen fires off an invocation
5. The operation completes
6. Jepsen writes the results of the operation to /run/jepsen/invoke_1234
7. Jepsen closes the FIFO
8. The shell script prints the results out and exits
9. The test composer receives the results

The types of commands are:

- `op-123`: Runs a single operation from the generator
- `check`: Wraps up the test's :generator, runs :final-generator, and
           checks the history.

This namespace provides the Jepsen-side infrastructure for watching the FIFO
directory, a test runner like `jepsen.core/run!`, and a CLI command called
`antithesis` which works like `test`, but uses our runner instead.
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