group name in test was too long, making dns exceptions

This commit is contained in:
Adrian Cole 2012-06-01 12:58:05 -07:00
parent 8159b6618f
commit 160cd273e2
1 changed files with 11 additions and 10 deletions

View File

@ -419,30 +419,31 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte
@Test(enabled = true, dependsOnMethods = "testCompareSizes") @Test(enabled = true, dependsOnMethods = "testCompareSizes")
public void testConcurrentUseOfComputeServiceToCreateNodes() throws Exception { public void testConcurrentUseOfComputeServiceToCreateNodes() throws Exception {
final long timeoutMs = 20*60*1000; final long timeoutMs = 20 * 60 * 1000;
List<String> groups = new ArrayList<String>(); List<String> groups = new ArrayList<String>();
List<ListenableFuture<NodeMetadata>> futures = new ArrayList<ListenableFuture<NodeMetadata>>(); List<ListenableFuture<NodeMetadata>> futures = new ArrayList<ListenableFuture<NodeMetadata>>();
ListeningExecutorService executor = MoreExecutors.listeningDecorator(context.utils().userExecutor()); ListeningExecutorService executor = MoreExecutors.listeningDecorator(context.utils().userExecutor());
try { try {
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
final int groupNum = i; final int groupNum = i;
final String group = "groupconcurrent"+groupNum; final String group = "twin" + groupNum;
groups.add(group); groups.add(group);
ListenableFuture<NodeMetadata> future = executor.submit(new Callable<NodeMetadata>() { ListenableFuture<NodeMetadata> future = executor.submit(new Callable<NodeMetadata>() {
public NodeMetadata call() throws Exception { public NodeMetadata call() throws Exception {
NodeMetadata node = getOnlyElement(client.createNodesInGroup(group, 1, NodeMetadata node = getOnlyElement(client.createNodesInGroup(group, 1, inboundPorts(22, 8080)
inboundPorts(22, 8080).blockOnPort(22, 300+groupNum))); .blockOnPort(22, 300 + groupNum)));
getAnonymousLogger().info("Started node "+node.getId()); getAnonymousLogger().info("Started node " + node.getId());
return node; return node;
}}); }
});
futures.add(future); futures.add(future);
} }
ListenableFuture<List<NodeMetadata>> compoundFuture = Futures.allAsList(futures); ListenableFuture<List<NodeMetadata>> compoundFuture = Futures.allAsList(futures);
compoundFuture.get(timeoutMs, TimeUnit.MILLISECONDS); compoundFuture.get(timeoutMs, TimeUnit.MILLISECONDS);
} finally { } finally {
for (String group : groups) { for (String group : groups) {
client.destroyNodesMatching(inGroup(group)); client.destroyNodesMatching(inGroup(group));