You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/09/26 19:12:06 UTC
[1/3] git commit: ACCUMULO-3175 Move test annotation timeouts into
the Rule with scaling factor.
Repository: accumulo
Updated Branches:
refs/heads/1.6.2-SNAPSHOT ecb5b5472 -> b43abcb5a
refs/heads/master 72dd8e16c -> ed3377626
ACCUMULO-3175 Move test annotation timeouts into the Rule with scaling factor.
Also include the scaling factor in some sleep/wait statements in tests.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b43abcb5
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b43abcb5
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b43abcb5
Branch: refs/heads/1.6.2-SNAPSHOT
Commit: b43abcb5ad12c4f33bd5f48af928cb1217e51f72
Parents: ecb5b54
Author: Josh Elser <el...@apache.org>
Authored: Fri Sep 26 12:50:06 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Sep 26 12:50:06 2014 -0400
----------------------------------------------------------------------
.../apache/accumulo/test/Accumulo3047IT.java | 11 ++-
.../test/ConfigurableMajorCompactionIT.java | 7 +-
.../accumulo/test/functional/LargeRowIT.java | 89 ++++++++++++--------
.../accumulo/test/functional/MergeIT.java | 11 ++-
.../accumulo/test/functional/PermissionsIT.java | 9 +-
5 files changed, 81 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java b/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java
index 74730b2..a333901 100644
--- a/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java
+++ b/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java
@@ -37,7 +37,12 @@ import org.junit.Assert;
import org.junit.Test;
public class Accumulo3047IT extends ConfigurableMacIT {
-
+
+ @Override
+ public int defaultTimeoutSeconds() {
+ return 60;
+ }
+
@Override
public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
cfg.setNumTservers(1);
@@ -45,7 +50,7 @@ public class Accumulo3047IT extends ConfigurableMacIT {
cfg.setProperty(Property.GC_CYCLE_START, "0s");
}
- @Test(timeout= 60 * 1000)
+ @Test
public void test() throws Exception {
// make a table
String tableName = getUniqueNames(1)[0];
@@ -70,5 +75,5 @@ public class Accumulo3047IT extends ConfigurableMacIT {
Assert.fail(entry.getKey().getRow().toString());
}
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java b/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
index 8968ea1..899b41b 100644
--- a/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
@@ -46,6 +46,11 @@ import org.junit.Test;
public class ConfigurableMajorCompactionIT extends ConfigurableMacIT {
@Override
+ public int defaultTimeoutSeconds() {
+ return 30;
+ }
+
+ @Override
public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
Map<String,String> siteConfig = new HashMap<String,String>();
siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "1s");
@@ -73,7 +78,7 @@ public class ConfigurableMajorCompactionIT extends ConfigurableMacIT {
}
}
- @Test(timeout = 30 * 1000)
+ @Test
public void test() throws Exception {
Connector conn = getConnector();
String tableName = "test";
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java b/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
index cf85ea9..32f8539 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
@@ -40,10 +40,12 @@ import org.apache.accumulo.test.TestIngest;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
public class LargeRowIT extends ConfigurableMacIT {
-
+
@Override
public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
cfg.setMemory(ServerType.TABLET_SERVER, cfg.getMemory(ServerType.TABLET_SERVER) * 2, MemoryUnit.BYTE);
@@ -62,7 +64,20 @@ public class LargeRowIT extends ConfigurableMacIT {
private static final int ROW_SIZE = 1 << 17;
private static final int NUM_PRE_SPLITS = 9;
private static final int SPLIT_THRESH = ROW_SIZE * NUM_ROWS / NUM_PRE_SPLITS;
-
+
+ private int timeoutFactor = 1;
+
+ @Before
+ public void setup() {
+ try {
+ timeoutFactor = Integer.parseInt(System.getProperty("timeout.factor"));
+ } catch (NumberFormatException e) {
+ log.warn("Could not parse property value for 'timeout.factor' as integer: " + System.getProperty("timeout.factor"));
+ }
+
+ Assert.assertTrue("Timeout factor must be greater than or equal to 1", timeoutFactor >= 1);
+ }
+
@Test
public void run() throws Exception {
Random r = new Random();
@@ -81,82 +96,82 @@ public class LargeRowIT extends ConfigurableMacIT {
test1(c);
test2(c);
}
-
+
private void test1(Connector c) throws Exception {
-
+
basicTest(c, REG_TABLE_NAME, 0);
-
+
c.tableOperations().setProperty(REG_TABLE_NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "" + SPLIT_THRESH);
-
- UtilWaitThread.sleep(12000);
+
+ UtilWaitThread.sleep(timeoutFactor * 12000);
Logger.getLogger(LargeRowIT.class).warn("checking splits");
FunctionalTestUtils.checkSplits(c, REG_TABLE_NAME, NUM_PRE_SPLITS / 2, NUM_PRE_SPLITS * 4);
-
+
verify(c, REG_TABLE_NAME);
}
-
+
private void test2(Connector c) throws Exception {
basicTest(c, PRE_SPLIT_TABLE_NAME, NUM_PRE_SPLITS);
}
-
+
private void basicTest(Connector c, String table, int expectedSplits) throws Exception {
BatchWriter bw = c.createBatchWriter(table, new BatchWriterConfig());
-
+
Random r = new Random();
byte rowData[] = new byte[ROW_SIZE];
-
+
r.setSeed(SEED);
-
+
for (int i = 0; i < NUM_ROWS; i++) {
-
+
r.nextBytes(rowData);
TestIngest.toPrintableChars(rowData);
-
+
Mutation mut = new Mutation(new Text(rowData));
mut.put(new Text(""), new Text(""), new Value(Integer.toString(i).getBytes(Constants.UTF8)));
bw.addMutation(mut);
}
-
+
bw.close();
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
verify(c, table);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
c.tableOperations().flush(table, null, null, false);
-
+
// verify while table flush is running
verify(c, table);
-
+
// give split time to complete
c.tableOperations().flush(table, null, null, true);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
verify(c, table);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
}
-
+
private void verify(Connector c, String table) throws Exception {
Random r = new Random();
byte rowData[] = new byte[ROW_SIZE];
-
+
r.setSeed(SEED);
-
+
Scanner scanner = c.createScanner(table, Authorizations.EMPTY);
-
+
for (int i = 0; i < NUM_ROWS; i++) {
-
+
r.nextBytes(rowData);
TestIngest.toPrintableChars(rowData);
-
+
scanner.setRange(new Range(new Text(rowData)));
-
+
int count = 0;
-
+
for (Entry<Key,Value> entry : scanner) {
if (!entry.getKey().getRow().equals(new Text(rowData))) {
throw new Exception("verification failed, unexpected row i =" + i);
@@ -166,13 +181,13 @@ public class LargeRowIT extends ConfigurableMacIT {
}
count++;
}
-
+
if (count != 1) {
throw new Exception("verification failed, unexpected count i =" + i + " count=" + count);
}
-
+
}
-
+
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
index 62cb141..c264dfe 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
@@ -40,6 +40,11 @@ import org.junit.Test;
public class MergeIT extends SimpleMacIT {
+ @Override
+ public int defaultTimeoutSeconds() {
+ return 8 * 60;
+ }
+
SortedSet<Text> splits(String[] points) {
SortedSet<Text> result = new TreeSet<Text>();
for (String point : points)
@@ -47,7 +52,7 @@ public class MergeIT extends SimpleMacIT {
return result;
}
- @Test(timeout = 60 * 1000)
+ @Test
public void merge() throws Exception {
Connector c = getConnector();
String tableName = getUniqueNames(1)[0];
@@ -65,7 +70,7 @@ public class MergeIT extends SimpleMacIT {
assertEquals(8, c.tableOperations().listSplits(tableName).size());
}
- @Test(timeout = 60 * 1000)
+ @Test
public void mergeSize() throws Exception {
Connector c = getConnector();
String tableName = getUniqueNames(1)[0];
@@ -99,7 +104,7 @@ public class MergeIT extends SimpleMacIT {
return strings;
}
- @Test(timeout = 8 * 60 * 1000)
+ @Test
public void mergeTest() throws Exception {
int tc = 0;
Connector c = getConnector();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
index d1c7190..d51dcbb 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
@@ -59,7 +59,12 @@ public class PermissionsIT extends SimpleMacIT {
return "user_" + userId.getAndIncrement();
}
- @Test(timeout = 60 * 1000)
+ @Override
+ public int defaultTimeoutSeconds() {
+ return 60;
+ }
+
+ @Test
public void systemPermissionsTest() throws Exception {
String testUser = makeUserName();
PasswordToken testPasswd = new PasswordToken("test_password");
@@ -376,7 +381,7 @@ public class PermissionsIT extends SimpleMacIT {
throw new IllegalStateException(user + " SHOULD NOT have system permission " + p);
}
- @Test(timeout = 30 * 1000)
+ @Test
public void tablePermissionTest() throws Exception {
// create the test user
String testUser = makeUserName();
[3/3] git commit: Merge branch '1.6.2-SNAPSHOT'
Posted by el...@apache.org.
Merge branch '1.6.2-SNAPSHOT'
Conflicts:
test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ed337762
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ed337762
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ed337762
Branch: refs/heads/master
Commit: ed337762621b24f5696243efabdabbc0201b2eea
Parents: 72dd8e1 b43abcb
Author: Josh Elser <el...@apache.org>
Authored: Fri Sep 26 13:11:52 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Sep 26 13:11:52 2014 -0400
----------------------------------------------------------------------
.../test/BadDeleteMarkersCreatedIT.java | 11 ++-
.../test/ConfigurableMajorCompactionIT.java | 7 +-
.../accumulo/test/functional/LargeRowIT.java | 89 ++++++++++++--------
.../accumulo/test/functional/MergeIT.java | 11 ++-
.../accumulo/test/functional/PermissionsIT.java | 9 +-
5 files changed, 81 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/ed337762/test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
----------------------------------------------------------------------
diff --cc test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
index 2add8c8,0000000..7d032c1
mode 100644,000000..100644
--- a/test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
@@@ -1,75 -1,0 +1,80 @@@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.test;
+
+import java.util.Map.Entry;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.core.metadata.schema.MetadataSchema;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
+import org.apache.accumulo.test.functional.ConfigurableMacIT;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.io.Text;
+import org.junit.Assert;
+import org.junit.Test;
+
+// Accumulo3047
+public class BadDeleteMarkersCreatedIT extends ConfigurableMacIT {
-
++
++ @Override
++ public int defaultTimeoutSeconds() {
++ return 60;
++ }
++
+ @Override
+ public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
+ cfg.setNumTservers(1);
+ cfg.setProperty(Property.GC_CYCLE_DELAY, "1s");
+ cfg.setProperty(Property.GC_CYCLE_START, "0s");
+ }
+
- @Test(timeout= 60 * 1000)
++ @Test
+ public void test() throws Exception {
+ // make a table
+ String tableName = getUniqueNames(1)[0];
+ Connector c = getConnector();
+ c.tableOperations().create(tableName);
+ // add some splits
+ SortedSet<Text> splits = new TreeSet<Text>();
+ for (int i = 0; i < 10; i++) {
+ splits.add(new Text("" + i));
+ }
+ c.tableOperations().addSplits(tableName, splits);
+ // get rid of all the splits
+ c.tableOperations().deleteRows(tableName, null, null);
+ // get rid of the table
+ c.tableOperations().delete(tableName);
+ // let gc run
+ UtilWaitThread.sleep(5 * 1000);
+ // look for delete markers
+ Scanner scanner = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
+ scanner.setRange(MetadataSchema.DeletesSection.getRange());
+ for (Entry<Key,Value> entry : scanner) {
+ Assert.fail(entry.getKey().getRow().toString());
+ }
+ }
-
++
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/ed337762/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
----------------------------------------------------------------------
diff --cc test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
index ea09018,32f8539..180da8e
--- a/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
@@@ -100,48 -113,48 +115,48 @@@ public class LargeRowIT extends Configu
private void test2(Connector c) throws Exception {
basicTest(c, PRE_SPLIT_TABLE_NAME, NUM_PRE_SPLITS);
}
-
+
private void basicTest(Connector c, String table, int expectedSplits) throws Exception {
BatchWriter bw = c.createBatchWriter(table, new BatchWriterConfig());
-
+
Random r = new Random();
byte rowData[] = new byte[ROW_SIZE];
-
+
r.setSeed(SEED);
-
+
for (int i = 0; i < NUM_ROWS; i++) {
-
+
r.nextBytes(rowData);
TestIngest.toPrintableChars(rowData);
-
+
Mutation mut = new Mutation(new Text(rowData));
- mut.put(new Text(""), new Text(""), new Value(Integer.toString(i).getBytes(Constants.UTF8)));
+ mut.put(new Text(""), new Text(""), new Value(Integer.toString(i).getBytes(StandardCharsets.UTF_8)));
bw.addMutation(mut);
}
-
+
bw.close();
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
verify(c, table);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
c.tableOperations().flush(table, null, null, false);
-
+
// verify while table flush is running
verify(c, table);
-
+
// give split time to complete
c.tableOperations().flush(table, null, null, true);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
verify(c, table);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
}
-
+
private void verify(Connector c, String table) throws Exception {
Random r = new Random();
byte rowData[] = new byte[ROW_SIZE];
[2/3] git commit: ACCUMULO-3175 Move test annotation timeouts into
the Rule with scaling factor.
Posted by el...@apache.org.
ACCUMULO-3175 Move test annotation timeouts into the Rule with scaling factor.
Also include the scaling factor in some sleep/wait statements in tests.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b43abcb5
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b43abcb5
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b43abcb5
Branch: refs/heads/master
Commit: b43abcb5ad12c4f33bd5f48af928cb1217e51f72
Parents: ecb5b54
Author: Josh Elser <el...@apache.org>
Authored: Fri Sep 26 12:50:06 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Sep 26 12:50:06 2014 -0400
----------------------------------------------------------------------
.../apache/accumulo/test/Accumulo3047IT.java | 11 ++-
.../test/ConfigurableMajorCompactionIT.java | 7 +-
.../accumulo/test/functional/LargeRowIT.java | 89 ++++++++++++--------
.../accumulo/test/functional/MergeIT.java | 11 ++-
.../accumulo/test/functional/PermissionsIT.java | 9 +-
5 files changed, 81 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java b/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java
index 74730b2..a333901 100644
--- a/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java
+++ b/test/src/test/java/org/apache/accumulo/test/Accumulo3047IT.java
@@ -37,7 +37,12 @@ import org.junit.Assert;
import org.junit.Test;
public class Accumulo3047IT extends ConfigurableMacIT {
-
+
+ @Override
+ public int defaultTimeoutSeconds() {
+ return 60;
+ }
+
@Override
public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
cfg.setNumTservers(1);
@@ -45,7 +50,7 @@ public class Accumulo3047IT extends ConfigurableMacIT {
cfg.setProperty(Property.GC_CYCLE_START, "0s");
}
- @Test(timeout= 60 * 1000)
+ @Test
public void test() throws Exception {
// make a table
String tableName = getUniqueNames(1)[0];
@@ -70,5 +75,5 @@ public class Accumulo3047IT extends ConfigurableMacIT {
Assert.fail(entry.getKey().getRow().toString());
}
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java b/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
index 8968ea1..899b41b 100644
--- a/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
@@ -46,6 +46,11 @@ import org.junit.Test;
public class ConfigurableMajorCompactionIT extends ConfigurableMacIT {
@Override
+ public int defaultTimeoutSeconds() {
+ return 30;
+ }
+
+ @Override
public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
Map<String,String> siteConfig = new HashMap<String,String>();
siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "1s");
@@ -73,7 +78,7 @@ public class ConfigurableMajorCompactionIT extends ConfigurableMacIT {
}
}
- @Test(timeout = 30 * 1000)
+ @Test
public void test() throws Exception {
Connector conn = getConnector();
String tableName = "test";
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java b/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
index cf85ea9..32f8539 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/LargeRowIT.java
@@ -40,10 +40,12 @@ import org.apache.accumulo.test.TestIngest;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
public class LargeRowIT extends ConfigurableMacIT {
-
+
@Override
public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
cfg.setMemory(ServerType.TABLET_SERVER, cfg.getMemory(ServerType.TABLET_SERVER) * 2, MemoryUnit.BYTE);
@@ -62,7 +64,20 @@ public class LargeRowIT extends ConfigurableMacIT {
private static final int ROW_SIZE = 1 << 17;
private static final int NUM_PRE_SPLITS = 9;
private static final int SPLIT_THRESH = ROW_SIZE * NUM_ROWS / NUM_PRE_SPLITS;
-
+
+ private int timeoutFactor = 1;
+
+ @Before
+ public void setup() {
+ try {
+ timeoutFactor = Integer.parseInt(System.getProperty("timeout.factor"));
+ } catch (NumberFormatException e) {
+ log.warn("Could not parse property value for 'timeout.factor' as integer: " + System.getProperty("timeout.factor"));
+ }
+
+ Assert.assertTrue("Timeout factor must be greater than or equal to 1", timeoutFactor >= 1);
+ }
+
@Test
public void run() throws Exception {
Random r = new Random();
@@ -81,82 +96,82 @@ public class LargeRowIT extends ConfigurableMacIT {
test1(c);
test2(c);
}
-
+
private void test1(Connector c) throws Exception {
-
+
basicTest(c, REG_TABLE_NAME, 0);
-
+
c.tableOperations().setProperty(REG_TABLE_NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "" + SPLIT_THRESH);
-
- UtilWaitThread.sleep(12000);
+
+ UtilWaitThread.sleep(timeoutFactor * 12000);
Logger.getLogger(LargeRowIT.class).warn("checking splits");
FunctionalTestUtils.checkSplits(c, REG_TABLE_NAME, NUM_PRE_SPLITS / 2, NUM_PRE_SPLITS * 4);
-
+
verify(c, REG_TABLE_NAME);
}
-
+
private void test2(Connector c) throws Exception {
basicTest(c, PRE_SPLIT_TABLE_NAME, NUM_PRE_SPLITS);
}
-
+
private void basicTest(Connector c, String table, int expectedSplits) throws Exception {
BatchWriter bw = c.createBatchWriter(table, new BatchWriterConfig());
-
+
Random r = new Random();
byte rowData[] = new byte[ROW_SIZE];
-
+
r.setSeed(SEED);
-
+
for (int i = 0; i < NUM_ROWS; i++) {
-
+
r.nextBytes(rowData);
TestIngest.toPrintableChars(rowData);
-
+
Mutation mut = new Mutation(new Text(rowData));
mut.put(new Text(""), new Text(""), new Value(Integer.toString(i).getBytes(Constants.UTF8)));
bw.addMutation(mut);
}
-
+
bw.close();
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
verify(c, table);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
c.tableOperations().flush(table, null, null, false);
-
+
// verify while table flush is running
verify(c, table);
-
+
// give split time to complete
c.tableOperations().flush(table, null, null, true);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
-
+
verify(c, table);
-
+
FunctionalTestUtils.checkSplits(c, table, expectedSplits, expectedSplits);
}
-
+
private void verify(Connector c, String table) throws Exception {
Random r = new Random();
byte rowData[] = new byte[ROW_SIZE];
-
+
r.setSeed(SEED);
-
+
Scanner scanner = c.createScanner(table, Authorizations.EMPTY);
-
+
for (int i = 0; i < NUM_ROWS; i++) {
-
+
r.nextBytes(rowData);
TestIngest.toPrintableChars(rowData);
-
+
scanner.setRange(new Range(new Text(rowData)));
-
+
int count = 0;
-
+
for (Entry<Key,Value> entry : scanner) {
if (!entry.getKey().getRow().equals(new Text(rowData))) {
throw new Exception("verification failed, unexpected row i =" + i);
@@ -166,13 +181,13 @@ public class LargeRowIT extends ConfigurableMacIT {
}
count++;
}
-
+
if (count != 1) {
throw new Exception("verification failed, unexpected count i =" + i + " count=" + count);
}
-
+
}
-
+
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
index 62cb141..c264dfe 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MergeIT.java
@@ -40,6 +40,11 @@ import org.junit.Test;
public class MergeIT extends SimpleMacIT {
+ @Override
+ public int defaultTimeoutSeconds() {
+ return 8 * 60;
+ }
+
SortedSet<Text> splits(String[] points) {
SortedSet<Text> result = new TreeSet<Text>();
for (String point : points)
@@ -47,7 +52,7 @@ public class MergeIT extends SimpleMacIT {
return result;
}
- @Test(timeout = 60 * 1000)
+ @Test
public void merge() throws Exception {
Connector c = getConnector();
String tableName = getUniqueNames(1)[0];
@@ -65,7 +70,7 @@ public class MergeIT extends SimpleMacIT {
assertEquals(8, c.tableOperations().listSplits(tableName).size());
}
- @Test(timeout = 60 * 1000)
+ @Test
public void mergeSize() throws Exception {
Connector c = getConnector();
String tableName = getUniqueNames(1)[0];
@@ -99,7 +104,7 @@ public class MergeIT extends SimpleMacIT {
return strings;
}
- @Test(timeout = 8 * 60 * 1000)
+ @Test
public void mergeTest() throws Exception {
int tc = 0;
Connector c = getConnector();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b43abcb5/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
index d1c7190..d51dcbb 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
@@ -59,7 +59,12 @@ public class PermissionsIT extends SimpleMacIT {
return "user_" + userId.getAndIncrement();
}
- @Test(timeout = 60 * 1000)
+ @Override
+ public int defaultTimeoutSeconds() {
+ return 60;
+ }
+
+ @Test
public void systemPermissionsTest() throws Exception {
String testUser = makeUserName();
PasswordToken testPasswd = new PasswordToken("test_password");
@@ -376,7 +381,7 @@ public class PermissionsIT extends SimpleMacIT {
throw new IllegalStateException(user + " SHOULD NOT have system permission " + p);
}
- @Test(timeout = 30 * 1000)
+ @Test
public void tablePermissionTest() throws Exception {
// create the test user
String testUser = makeUserName();