anchor.diff:      check(prop_basic_listkeys(), current_counterexample()).
   
   dep_apps() ->
  +    Silencer = fun(load) ->
  +                       %% Silence logging junk
  +                       application:set_env(kernel, error_logger, silent),
  +                       filelib:ensure_dir("keys_fsm_eqc/log/sasl.log"),
  +                       application:set_env(sasl, sasl_error_logger, {file, "keys_fsm_eqc/log/sasl.log"}),
  +                       error_logger:tty(false);
  +                  (_) -> ok
  +               end,
  +
       SetupFun =
  -        fun(start) ->
  -            %% Set some missing env vars that are normally
  -            %% part of release packaging.
  -            application:set_env(riak_core, ring_creation_size, 64),
  -            application:set_env(riak_kv, storage_backend, riak_kv_memory_backend),
  -            application:set_env(riak_kv, vnode_vclocks, true),
  -            application:set_env(riak_kv, delete_mode, immediate),
  -            application:set_env(riak_kv, legacy_keylisting, false),
  -
  -            %% Start riak_kv
  -            timer:sleep(500);
  -           (stop) ->
  -            ok
  +        fun(load) ->
  +                %% Set some missing env vars that are normally
  +                %% part of release packaging.
  +                application:set_env(riak_core, ring_creation_size, 64),
  +                application:set_env(riak_core, ring_state_dir, "keys_fsm_eqc/ring"),
  +                application:set_env(riak_core, platform_data_dir, "keys_fsm_eqc/data"),
  +                application:set_env(riak_kv, storage_backend, riak_kv_memory_backend),
  +                application:set_env(riak_kv, test, true),
  +                application:set_env(riak_kv, vnode_vclocks, true),
  +                application:set_env(riak_kv, delete_mode, immediate),
  +                application:set_env(riak_kv, legacy_keylisting, false),
  +                application:set_env(lager, handlers, [{lager_file_backend, [{"keys_fsm_eqc/log/debug.log", debug, 10485760, "$D0", 5}]}]),
  +                application:set_env(lager, crash_log, "keys_fsm_eqc/log/crash.log");
  +           (_) -> ok
           end,
  -    XX = fun(_) -> error_logger:info_msg("Registered: ~w\n", [lists:sort(registered())]) end,
  -    [sasl, crypto, riak_sysmon, webmachine, XX, os_mon,
  -     compiler, syntax_tools, lager, riak_core, XX, luke, erlang_js,
  -     inets, mochiweb, riak_pipe, SetupFun, riak_kv, SetupFun].
  +
  +    [sasl, Silencer, crypto, public_key, ssl, riak_sysmon, os_mon,
  +     runtime_tools, erlang_js, inets, mochiweb, webmachine, luke,
  +     basho_stats, bitcask, compiler, syntax_tools, lager, folsom,
  +     riak_core, riak_pipe, riak_kv, SetupFun].
  +
   
   do_dep_apps(StartStop, Apps) ->
       lists:map(fun(A) when is_atom(A) -> application:StartStop(A);
  
positive.code: %% Helpers
  %%====================================================================
  
  prepare() ->
      application:load(sasl),
      error_logger:delete_report_handler(sasl_report_tty_h),
      error_logger:delete_report_handler(error_logger_tty_h),
  
      TestNode = list_to_atom("testnode" ++ integer_to_list(element(3, now())) ++
                                  "@localhost"),
      {ok, _} = net_kernel:start([TestNode, longnames]),
      do_dep_apps(start, dep_apps()),
      ok.
  
  test() ->
      test(100).
  
  
negative.code:             ?debugFmt("Received keys for older run: ~p~n", [ORef])
      end.
  
  -endif. % EQC
  
  