Skip to content

Instantly share code, notes, and snippets.

@jlouis
Created March 11, 2016 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlouis/f072b380e63f89f70b5c to your computer and use it in GitHub Desktop.
Save jlouis/f072b380e63f89f70b5c to your computer and use it in GitHub Desktop.
Typical awesome scenarios caught for QuickCheck in jlouis/fuse

Switching:

  1. Install a standard fuse
  2. Install a fault_injection fuse which overrides the standard fuse

Notice that the ETS table is not updated correct for step 2.

Disabling:

fuse_eqc:install(isabella, {{standard, 1, 1}, {reset, 60000}}) -> ok.
fuse_eqc:circuit_disable(isabella) -> ok.
fuse_eqc:install(isabella,
    {{fault_injection, 1.0e-19, 1, 1}, {reset, 60000}}) ->
  ok.
fuse_eqc:ask_installed(isabella) ->
  exit({mocking_error, unexpected}) = fuse_rand:uniform(),
  • Install a fuse
  • Disable said fuse
  • Install a new fuse, with fault_injection
  • Ask the newly installed fuse for its state and observe it is wrong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment