You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ma...@apache.org on 2020/04/23 00:49:21 UTC
[incubator-pinot] 01/01: Add proper closing of S3PinotFS and
S3Client in S3PinotFSTest.
This is an automated email from the ASF dual-hosted git repository.
mayanks pushed a commit to branch s3-fix
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
commit 3bf85abd7ef1d0577f878d8f3bc29eeaf2048a97
Author: Mayank Shrivastava <ms...@linkedin.com>
AuthorDate: Wed Apr 22 16:06:05 2020 -0700
Add proper closing of S3PinotFS and S3Client in S3PinotFSTest.
1. Added a tearDown() method for propoer un-initialization.
2. Changed the annotation from @BeforeMethod to @BeforeClass, as it only
needs to be done once.
3. Temporarily disabling the test as it seems to give the following error, that is blocking
weekly-release:
23:59:48.761 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -
***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 1947 was already in use.
Action:
Identify and stop the process that's listening on port 1947 or configure this application to listen on another port.
---
.../org/apache/pinot/plugin/filesystem/S3PinotFSTest.java | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/pinot-plugins/pinot-file-system/pinot-s3/src/test/java/org/apache/pinot/plugin/filesystem/S3PinotFSTest.java b/pinot-plugins/pinot-file-system/pinot-s3/src/test/java/org/apache/pinot/plugin/filesystem/S3PinotFSTest.java
index 4ba52fb..4477dab 100644
--- a/pinot-plugins/pinot-file-system/pinot-s3/src/test/java/org/apache/pinot/plugin/filesystem/S3PinotFSTest.java
+++ b/pinot-plugins/pinot-file-system/pinot-s3/src/test/java/org/apache/pinot/plugin/filesystem/S3PinotFSTest.java
@@ -20,6 +20,7 @@ package org.apache.pinot.plugin.filesystem;
import com.adobe.testing.s3mock.testng.S3Mock;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.StandardCharsets;
@@ -28,7 +29,8 @@ import java.util.Arrays;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import software.amazon.awssdk.core.sync.RequestBody;
@@ -39,7 +41,7 @@ import software.amazon.awssdk.services.s3.model.ListObjectsV2Response;
import software.amazon.awssdk.services.s3.model.S3Object;
-@Test
+@Test(enabled = false)
@Listeners(com.adobe.testing.s3mock.testng.S3MockListener.class)
public class S3PinotFSTest {
final String DELIMITER = "/";
@@ -50,7 +52,7 @@ public class S3PinotFSTest {
final String FILE_FORMAT = "%s://%s/%s";
final String DIR_FORMAT = "%s://%s";
- @BeforeMethod
+ @BeforeClass
public void setUp() {
S3Mock s3Mock = S3Mock.getInstance();
_s3Client = s3Mock.createS3ClientV2();
@@ -59,6 +61,13 @@ public class S3PinotFSTest {
_s3Client.createBucket(CreateBucketRequest.builder().bucket(BUCKET).build());
}
+ @AfterClass
+ public void tearDown()
+ throws IOException {
+ _s3PinotFS.close();
+ _s3Client.close();
+ }
+
private void createEmptyFile(String folderName, String fileName) {
String fileNameWithFolder = folderName + DELIMITER + fileName;
_s3Client
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org