From 52dcae159e9529101c57a88d3ec33451a430114e Mon Sep 17 00:00:00 2001 From: sears Date: Thu, 25 Feb 2010 19:03:20 +0000 Subject: [PATCH] fix 3 of 4 unit test regressions git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@628 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe --- test/check_merge.cpp | 8 +++----- test/check_mergelarge.cpp | 6 +++--- test/check_mergetuple.cpp | 8 +++----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/test/check_merge.cpp b/test/check_merge.cpp index 4a124bc..690cc5f 100644 --- a/test/check_merge.cpp +++ b/test/check_merge.cpp @@ -55,14 +55,13 @@ void insertProbeIter(size_t NUM_ENTRIES) recordid table_root = ltable.allocTable(xid); Tcommit(xid); - - xid = Tbegin(); + writelock(ltable.header_lock,0); int lindex = mscheduler.addlogtable(<able); ltable.setMergeData(mscheduler.getMergeData(lindex)); - - mscheduler.startlogtable(lindex); + mscheduler.startlogtable(lindex); + unlock(ltable.header_lock); printf("Stage 1: Writing %d keys\n", NUM_ENTRIES); struct timeval start_tv, stop_tv, ti_st, ti_end; @@ -102,7 +101,6 @@ void insertProbeIter(size_t NUM_ENTRIES) printf("datasize: %lld\n", (long long)datasize); //sleep(20); - Tcommit(xid); xid = Tbegin(); diff --git a/test/check_mergelarge.cpp b/test/check_mergelarge.cpp index ca00f3f..02c8237 100644 --- a/test/check_mergelarge.cpp +++ b/test/check_mergelarge.cpp @@ -54,13 +54,13 @@ void insertProbeIter(size_t NUM_ENTRIES) recordid table_root = ltable.allocTable(xid); Tcommit(xid); - - //xid = Tbegin(); + writelock(ltable.header_lock,0); int lindex = mscheduler.addlogtable(<able); ltable.setMergeData(mscheduler.getMergeData(lindex)); - + mscheduler.startlogtable(lindex); + unlock(ltable.header_lock); printf("Stage 1: Writing %d keys\n", NUM_ENTRIES); diff --git a/test/check_mergetuple.cpp b/test/check_mergetuple.cpp index 668dbc8..18ba05a 100644 --- a/test/check_mergetuple.cpp +++ b/test/check_mergetuple.cpp @@ -112,13 +112,12 @@ void insertProbeIter(size_t NUM_ENTRIES) recordid table_root = ltable.allocTable(xid); Tcommit(xid); - - xid = Tbegin(); - + writelock(ltable.header_lock,0); int lindex = mscheduler.addlogtable(<able); ltable.setMergeData(mscheduler.getMergeData(lindex)); - + mscheduler.startlogtable(lindex); + unlock(ltable.header_lock); printf("Stage 1: Writing %d keys\n", NUM_ENTRIES); @@ -197,7 +196,6 @@ void insertProbeIter(size_t NUM_ENTRIES) printf("\nTREE STRUCTURE\n"); printf("datasize: %lld\n", datasize); - Tcommit(xid); xid = Tbegin();