Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix Travis CI failure of multiple_merges_during_fold_test #74

Merged
merged 3 commits into from

2 participants

Joseph Blomstedt Scott Lystig Fritchie
Joseph Blomstedt
Owner

The environment that Travis runs test under unfortunately does not immediately pick up the expected number of files to merge for the different merge operations in the multiple_merges_during_fold_test. This commit changes the test to re-try merging until the expected result is seen (or eventually have the test timeout).

Joseph Blomstedt jtuple Fix Travis CI failure of multiple_merges_during_fold_test
The environment that Travis runs test under unfortunately does not
immediately pick up the expected number of files to merge for the
different merge operations in the multiple_merges_during_fold_test.
This commit changes the test to re-try merging until the expected
result is seen (or eventually have the test timeout).
0b0a339
src/bitcask.erl
((5 lines not shown))
-include_lib("eunit/include/eunit.hrl").
+-ifdef(TEST).
+%% -include_lib("eunit/include/eunit.hrl").
Scott Lystig Fritchie Owner

Shouldn't the eunit.hrl header be -ifdef'ified and uncommented? This looks like a bit of debugging cruft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Scott Lystig Fritchie slfritchie merged commit 66d5cae into from
Engel A. Sanchez engelsanchez deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 3, 2012
  1. Joseph Blomstedt

    Fix Travis CI failure of multiple_merges_during_fold_test

    jtuple authored
    The environment that Travis runs test under unfortunately does not
    immediately pick up the expected number of files to merge for the
    different merge operations in the multiple_merges_during_fold_test.
    This commit changes the test to re-try merging until the expected
    result is seen (or eventually have the test timeout).
Commits on Mar 5, 2013
  1. Scott Lystig Fritchie
  2. Scott Lystig Fritchie
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 10 deletions.
  1. +13 −7 src/bitcask_merge_delete.erl
  2. +4 −3 test/bitcask_qc_fsm.erl
20 src/bitcask_merge_delete.erl
View
@@ -138,7 +138,7 @@ delete_files(Files) ->
-ifdef(TEST).
multiple_merges_during_fold_test_() ->
- {timeout, 10, fun multiple_merges_during_fold_test_body/0}.
+ {timeout, 60, fun multiple_merges_during_fold_test_body/0}.
multiple_merges_during_fold_test_body() ->
Dir = "/tmp/bc.multiple-merges-fold",
@@ -166,15 +166,11 @@ multiple_merges_during_fold_test_body() ->
bitcask:has_setuid_bit(F)])
end,
PutSome(),
- bitcask:merge(Dir),
- Count1 = CountSetuids(),
- true = (Count1 > 0),
+ Count1 = merge_until(Dir, 0, CountSetuids),
PutSome(),
bitcask:merge(Dir),
PutSome(),
- bitcask:merge(Dir),
- Count2 = CountSetuids(),
- true = (Count2 > Count1),
+ merge_until(Dir, Count1, CountSetuids),
SlowPid ! go_ahead,
timer:sleep(500),
@@ -183,4 +179,14 @@ multiple_merges_during_fold_test_body() ->
ok.
+merge_until(Dir, MinCount, CountSetuids) ->
+ bitcask:merge(Dir),
+ Count = CountSetuids(),
+ if (Count > MinCount) ->
+ Count;
+ true ->
+ timer:sleep(100),
+ merge_until(Dir, MinCount, CountSetuids)
+ end.
+
-endif. %% TEST
7 test/bitcask_qc_fsm.erl
View
@@ -108,10 +108,11 @@ postcondition(_From,_To,_S,{call,_,_,_},_Res) ->
true.
qc_test_() ->
- {timeout, 120,
+ TestTime = 45,
+ {timeout, TestTime*2,
{setup, fun prepare/0, fun cleanup/1,
- [{timeout, 120, ?_assertEqual(true,
- eqc:quickcheck(?QC_OUT(prop_bitcask())))}]}}.
+ [{timeout, TestTime*2, ?_assertEqual(true,
+ eqc:quickcheck(eqc:testing_time(TestTime, ?QC_OUT(prop_bitcask()))))}]}}.
prepare() ->
application:load(bitcask),
Something went wrong with that request. Please try again.