jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs-aws] Health check and Subnet API (#70)
Date Wed, 25 Jan 2017 13:41:00 GMT
nacx commented on this pull request.

Just one minor comment regarding the live test cleanup.

> +              .credentials(identity, credential)
+              .buildView(typeToken(EC2ComputeServiceContext.class));
+
+     ec2Api = ec2ComputeServiceContext.unwrapApi(EC2Api.class);
+
+   }
+
+   private void createTestLoadBalancer (){
+      api.getLoadBalancerApi().createListeningInAvailabilityZones(loadBalancerName, Listener.builder()
+              .protocol(Protocol.HTTP)
+              .port(80)
+              .instanceProtocol(Protocol.HTTP)
+              .instancePort(80)
+              .build(), ImmutableList.of("us-east-1b"));
+   }
+   @AfterClass

Better use `@AfterClass(alwaysRun = true)`, to make sure the cleanup happens even if tests
fail. This way we do a best effort to avoid leaking resources generated during the tests.
Apply this to the other created live test classes that can benefit from this pattern.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/70#pullrequestreview-18398900
Mime
View raw message