You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2012/09/19 14:50:41 UTC
svn commit: r1387564 -
/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
Author: mbautin
Date: Wed Sep 19 12:50:41 2012
New Revision: 1387564
URL: http://svn.apache.org/viewvc?rev=1387564&view=rev
Log:
[HBASE-6059] Fixing failing test
Author: lipi
Modified:
hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java?rev=1387564&r1=1387563&r2=1387564&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java Wed Sep 19 12:50:41 2012
@@ -168,12 +168,19 @@ public class TestStore extends TestCase
for (int i = 1; i <= storeFileNum; i++) {
// verify the expired store file.
CompactionRequest cr = this.store.requestCompaction();
- assertEquals(1, cr.getFiles().size());
- assertTrue(cr.getFiles().get(0).getReader().getMaxTimestamp() <
- (System.currentTimeMillis() - store.ttl));
- // Verify that the expired the store has been deleted.
+ // the first is expired normally.
+ // If not the first compaction, there is another empty store file,
+ assertEquals(Math.min(i, 2), cr.getFiles().size());
+ for (int j = 0; i < cr.getFiles().size(); j++) {
+ assertTrue(cr.getFiles().get(j).getReader().getMaxTimestamp() < (System
+ .currentTimeMillis() - this.store.ttl));
+ }
+ // Verify that the expired store file is compacted to an empty store file.
this.store.compact(cr);
- assertEquals(storeFileNum - i, this.store.getStorefiles().size());
+
+ // It is an empty store file.
+ assertEquals(0, this.store.getStorefiles().get(0).getReader()
+ .getEntries());
// Let the next store file expired.
Thread.sleep(sleepTime);