machi/test
Scott Lystig Fritchie 9b0a5a1dc3 WIP: 1st part of moving old chain state transtion code to new
Ha, famous last words, amirite?

    %% The chain sequence/order checks at the bottom of this function aren't
    %% as easy-to-read as they ought to be.  However, I'm moderately confident
    %% that it isn't buggy.  TODO: refactor them for clarity.

So, now machi_chain_manager1:projection_transition_is_sane() is using
newer, far less buggy code to make sanity decisions.

TODO: Add support for Retrospective mode. TODO is it really needed?

Examples of how the old code sucks and the new code sucks less.

    138> eqc:quickcheck(eqc:testing_time(10, machi_chain_manager1_test:prop_compare_legacy_with_v2_chain_transition_check(whole))).
    xxxxxxxxxxxx..x.xxxxxx..x.x....x..xx........................................................Failed! After 69 tests.
    [a,b,c]
    {c,[a,b,c],[c,b],b,[b,a],[b,a,c]}
    Old_res ([335,192,166,160,153,139]): true
    New_res: false (why line [1936])
    Shrinking xxxxxxxxxxxx.xxxxxxx.xxx.xxxxxxxxxxxxxxxxx(3 times)
    [a,b,c]
 %% {Author1,UPI1,   Repair1,Author2,UPI2, Repair2} %%
    {c,      [a,b,c],[],     a,      [b,a],[]}
    Old_res ([338,185,160,153,147]): true
    New_res: false (why line [1936])
    false

Old code is wrong: we've swapped order of a & b, which is bad.

    139> eqc:quickcheck(eqc:testing_time(10, machi_chain_manager1_test:prop_compare_legacy_with_v2_chain_transition_check(whole))).
    xxxxxxxxxx..x...xx..........xxx..x..............x......x............................................(x10)...(x1)........Failed! After 120 tests.
    [b,c,a]
    {c,[c,a],[c],a,[a,b],[b,a]}
    Old_res ([335,192,185,160,153,123]): true
    New_res: false (why line [1936])
    Shrinking xx.xxxxxx.x.xxxxxxxx.xxxxxxxxxxx(4 times)
    [b,a,c]
 %% {Author1,UPI1,Repair1,Author2,UPI2, Repair2} %%
    {a,      [c], [],     c,      [c,b],[]}
    Old_res ([338,185,160,153,147]): true
    New_res: false (why line [1936])
    false

Old code is wrong: b wasn't repairing in the previous state.

    150> eqc:quickcheck(eqc:testing_time(10, machi_chain_manager1_test:prop_compare_legacy_with_v2_chain_transition_check(whole))).
    xxxxxxxxxxx....x...xxxxx..xx.....x.......xxx..x.......xxx...................x................x......(x10).....(x1)........xFailed! After 130 tests.
    [c,a,b]
    {b,[c],[b,a,c],c,[c,a,b],[b]}
    Old_res ([335,214,185,160,153,147]): true
    New_res: false (why line [1936])
    Shrinking xxxx.x.xxx.xxxxxxx.xxxxxxxxx(4 times)
    [c,b,a]
 %% {Author1,UPI1,Repair1,Author2,UPI2,   Repair2} %%
    {c,      [c], [a,b],  c,      [c,b,a],[]}
    Old_res ([335,328,185,160,153,111]): true
    New_res: false (why line [1981,1679])
    false

Old code is wrong: a & b were repairing but UPI2 has a & b in the wrong order.
2015-07-04 00:32:28 +09:00
..
legacy WIP: it's clear that the legacy state transition check is broken, II 2015-07-03 23:37:36 +09:00
pulse_util WIP: client side projection store, 1st API op (write), part II 2015-04-03 17:10:52 +09:00
machi_admin_util_test.erl Clarify verify_file_checksums_test_ 2015-07-01 14:16:31 +09:00
machi_chain_manager1_converge_demo.erl WIP: Refactoring and prototyping goop, broken test 2015-07-03 00:59:04 +09:00
machi_chain_manager1_pulse.erl WIP: Refactoring and prototyping goop, broken test 2015-07-03 00:59:04 +09:00
machi_chain_manager1_test.erl WIP: 1st part of moving old chain state transtion code to new 2015-07-04 00:32:28 +09:00
machi_cr_client_test.erl WIP: all eunit tests are passing again, yay 2015-06-30 16:12:23 +09:00
machi_flu1_test.erl WIP: all eunit tests are passing again, yay 2015-06-30 16:12:23 +09:00
machi_flu_psup_test.erl Fix epoch checking in eunit tests and enforcement by FLU (always permit list_files()) 2015-07-01 18:12:22 +09:00
machi_partition_simulator.erl WIP: some TODO cleanup & related refactoring 2015-04-10 22:00:52 +09:00
machi_pb_high_client_test.erl WIP: all eunit tests are passing again, yay 2015-06-30 16:12:23 +09:00
machi_pb_test.erl WIP: giant hairball 11 2015-06-29 16:24:57 +09:00
machi_projection_test.erl WIP: wip wip a doowip 2015-06-02 22:13:15 +09:00
machi_proxy_flu1_client_test.erl WIP: all eunit tests are passing again, yay 2015-06-30 16:12:23 +09:00