Introduce cpse_test_purge_seqs again 1831/head
authorjiangph <jiangph@cn.ibm.com>
Tue, 25 Dec 2018 10:23:00 +0000 (18:23 +0800)
committerjiangph <jiangph@cn.ibm.com>
Thu, 3 Jan 2019 02:13:28 +0000 (10:13 +0800)
  - Re-introduce cpse_test_purge_seqs after fixing issue on
  cpse_test_purge_seqs:cpse_increment_purge_seq_on_partial_purge/1
  with undef issue

src/couch_pse_tests/src/cpse_test_purge_seqs.erl
src/couch_pse_tests/src/cpse_util.erl

index 057d6da..f363b76 100644 (file)
@@ -12,7 +12,6 @@
 
 -module(cpse_test_purge_seqs).
 -compile(export_all).
--compile(nowarn_export_all).
 
 
 -include_lib("eunit/include/eunit.hrl").
@@ -99,10 +98,13 @@ cpse_increment_purge_multiple_times(DbName) ->
 
 
 cpse_increment_purge_seq_on_partial_purge(DbName) ->
-    Doc1 = {[{'_id', foo}, {vsn, 1}]},
-    Doc2 = {[{'_id', foo}, {vsn, 2}]},
-    {ok, Rev1} = cpse_util:save_doc(DbName, Doc1),
-    {ok, _Rev2} = cpse_util:save_doc(DbName, Doc2, [replicated_changes]),
+    {ok, Rev1} = cpse_util:save_doc(DbName, {[{'_id', foo1}, {vsn, <<"1.1">>}]}),
+    Update = {[
+        {'_id', foo1},
+        {'_rev', couch_doc:rev_to_str({1, [crypto:hash(md5, <<"1.2">>)]})},
+        {vsn, <<"1.2">>}
+    ]},
+    {ok, [_Rev2]} = cpse_util:save_docs(DbName, [Update], [replicated_changes]),
 
     cpse_util:assert_db_props(?MODULE, ?LINE, DbName, [
         {doc_count, 1},
index 7556d23..1bf2431 100644 (file)
@@ -31,7 +31,8 @@
     cpse_test_purge_replication,
     cpse_test_purge_bad_checkpoints,
     cpse_test_compaction,
-    cpse_test_ref_counting
+    cpse_test_ref_counting,
+    cpse_test_purge_seqs
 ]).