You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/07/15 03:16:30 UTC
[doris] branch master updated: [enhance](test): remove some `System.out.println` in UT. (#10859)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 33e9d5b2da [enhance](test): remove some `System.out.println` in UT. (#10859)
33e9d5b2da is described below
commit 33e9d5b2da5ce412276adf508ee6ea448897fab7
Author: jakevin <ja...@gmail.com>
AuthorDate: Fri Jul 15 11:16:24 2022 +0800
[enhance](test): remove some `System.out.println` in UT. (#10859)
---
.../org/apache/doris/alter/SchemaChangeHandlerTest.java | 3 ---
.../java/org/apache/doris/backup/BackupJobInfoTest.java | 2 --
.../test/java/org/apache/doris/backup/BackupJobTest.java | 1 -
.../java/org/apache/doris/catalog/MetadataViewerTest.java | 2 --
.../org/apache/doris/clone/ClusterLoadStatisticsTest.java | 1 -
.../org/apache/doris/http/TableQueryPlanActionTest.java | 13 ++++++-------
.../java/org/apache/doris/http/TableRowCountActionTest.java | 2 +-
.../apache/doris/load/routineload/KafkaProducerTest.java | 7 ++-----
.../src/test/java/org/apache/doris/policy/PolicyTest.java | 1 -
.../java/org/apache/doris/qe/JournalObservableTest.java | 1 -
.../test/java/org/apache/doris/system/HeartbeatMgrTest.java | 1 -
.../java/org/apache/doris/system/SystemInfoServiceTest.java | 1 -
12 files changed, 9 insertions(+), 26 deletions(-)
diff --git a/fe/fe-core/src/test/java/org/apache/doris/alter/SchemaChangeHandlerTest.java b/fe/fe-core/src/test/java/org/apache/doris/alter/SchemaChangeHandlerTest.java
index 9fcc04dc98..2276c79675 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/alter/SchemaChangeHandlerTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/alter/SchemaChangeHandlerTest.java
@@ -101,7 +101,6 @@ public class SchemaChangeHandlerTest extends TestWithFeService {
tbl.readLock();
try {
Assertions.assertNotNull(tbl);
- System.out.println(tbl.getName());
Assertions.assertEquals("Doris", tbl.getEngine());
Assertions.assertEquals(9, tbl.getBaseSchema().size());
} finally {
@@ -245,7 +244,6 @@ public class SchemaChangeHandlerTest extends TestWithFeService {
tbl.readLock();
try {
Assertions.assertNotNull(tbl);
- System.out.println(tbl.getName());
Assertions.assertEquals("Doris", tbl.getEngine());
Assertions.assertEquals(8, tbl.getBaseSchema().size());
} finally {
@@ -302,7 +300,6 @@ public class SchemaChangeHandlerTest extends TestWithFeService {
tbl.readLock();
try {
Assertions.assertNotNull(tbl);
- System.out.println(tbl.getName());
Assertions.assertEquals("Doris", tbl.getEngine());
Assertions.assertEquals(6, tbl.getBaseSchema().size());
} finally {
diff --git a/fe/fe-core/src/test/java/org/apache/doris/backup/BackupJobInfoTest.java b/fe/fe-core/src/test/java/org/apache/doris/backup/BackupJobInfoTest.java
index c791a07b96..912c62f86c 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/backup/BackupJobInfoTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/backup/BackupJobInfoTest.java
@@ -150,7 +150,6 @@ public class BackupJobInfoTest {
Assert.fail();
}
Assert.assertNotNull(jobInfo);
- System.out.println(jobInfo.toString());
Assert.assertEquals(1522231864000L, jobInfo.backupTime);
Assert.assertEquals("snapshot1", jobInfo.name);
@@ -160,7 +159,6 @@ public class BackupJobInfoTest {
Assert.assertEquals(2, jobInfo.getOlapTableInfo("table1").getPartInfo("partition1").indexes.size());
Assert.assertEquals(2,
jobInfo.getOlapTableInfo("table1").getPartInfo("partition1").getIdx("rollup1").tablets.size());
- System.out.println(jobInfo.getOlapTableInfo("table1").getPartInfo("partition1").getIdx("rollup1").tablets);
Assert.assertEquals(2,
jobInfo.getOlapTableInfo("table1").getPartInfo("partition1")
.getIdx("rollup1").getTabletFiles(10007L).size());
diff --git a/fe/fe-core/src/test/java/org/apache/doris/backup/BackupJobTest.java b/fe/fe-core/src/test/java/org/apache/doris/backup/BackupJobTest.java
index 19e60076be..c0fac9199d 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/backup/BackupJobTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/backup/BackupJobTest.java
@@ -267,7 +267,6 @@ public class BackupJobTest {
Assert.assertEquals(job.getJobId(), upTask.getJobId());
Map<String, String> srcToDest = upTask.getSrcToDestPath();
Assert.assertEquals(1, srcToDest.size());
- System.out.println(srcToDest);
String dest = srcToDest.get(snapshotPath + "/" + tabletId + "/" + 0);
Assert.assertNotNull(dest);
diff --git a/fe/fe-core/src/test/java/org/apache/doris/catalog/MetadataViewerTest.java b/fe/fe-core/src/test/java/org/apache/doris/catalog/MetadataViewerTest.java
index dde1b17db3..4b8c40de2c 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/catalog/MetadataViewerTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/MetadataViewerTest.java
@@ -109,7 +109,6 @@ public class MetadataViewerTest {
null };
List<List<String>> result = (List<List<String>>) getTabletStatusMethod.invoke(null, args);
Assert.assertEquals(3, result.size());
- System.out.println(result);
args = new Object[] { CatalogMocker.TEST_DB_NAME, CatalogMocker.TEST_TBL_NAME, partitions, ReplicaStatus.DEAD,
Operator.EQ };
@@ -128,7 +127,6 @@ public class MetadataViewerTest {
Object[] args = new Object[] { CatalogMocker.TEST_DB_NAME, CatalogMocker.TEST_TBL_NAME, null };
List<List<String>> result = (List<List<String>>) getTabletDistributionMethod.invoke(null, args);
Assert.assertEquals(3, result.size());
- System.out.println(result);
}
}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/clone/ClusterLoadStatisticsTest.java b/fe/fe-core/src/test/java/org/apache/doris/clone/ClusterLoadStatisticsTest.java
index d4215d2f29..72861dfeb2 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/clone/ClusterLoadStatisticsTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/clone/ClusterLoadStatisticsTest.java
@@ -147,7 +147,6 @@ public class ClusterLoadStatisticsTest {
Tag.DEFAULT_BACKEND_TAG, systemInfoService, invertedIndex);
loadStatistic.init();
List<List<String>> infos = loadStatistic.getClusterStatistic(TStorageMedium.HDD);
- System.out.println(infos);
Assert.assertEquals(3, infos.size());
}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/http/TableQueryPlanActionTest.java b/fe/fe-core/src/test/java/org/apache/doris/http/TableQueryPlanActionTest.java
index 581fdfd204..219a48f2a6 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/http/TableQueryPlanActionTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/http/TableQueryPlanActionTest.java
@@ -36,7 +36,7 @@ import java.util.Base64;
public class TableQueryPlanActionTest extends DorisHttpTestCase {
- private static String PATH_URI = "/_query_plan";
+ private static String PATH_URI = "/_query_plan";
protected static String ES_TABLE_URL;
@Override
@@ -56,9 +56,9 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(URI + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
+ Assert.assertNotNull(response.body());
String respStr = response.body().string();
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
- System.out.println(respStr);
Assert.assertEquals(200, (long) ((JSONObject) jsonObject.get("data")).get("status"));
JSONObject partitionsObject = (JSONObject) ((JSONObject) jsonObject.get("data")).get("partitions");
@@ -88,9 +88,8 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(URI + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
+ Assert.assertNotNull(response.body());
String respStr = response.body().string();
- System.out.println(respStr);
- Assert.assertNotNull(respStr);
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
Assert.assertEquals(403, (long) jsonObject.get("code"));
String exception = (String) jsonObject.get("data");
@@ -107,8 +106,8 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(URI + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
+ Assert.assertNotNull(response.body());
String respStr = response.body().string();
- System.out.println(respStr);
Assert.assertNotNull(respStr);
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
Assert.assertEquals(403, (long) jsonObject.get("code"));
@@ -127,8 +126,8 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(URI + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
+ Assert.assertNotNull(response.body());
String respStr = response.body().string();
- System.out.println(respStr);
Assert.assertNotNull(respStr);
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
Assert.assertEquals(400, (long) ((JSONObject) jsonObject.get("data")).get("status"));
@@ -166,10 +165,10 @@ public class TableQueryPlanActionTest extends DorisHttpTestCase {
.url(ES_TABLE_URL + PATH_URI)
.build();
Response response = networkClient.newCall(request).execute();
+ Assert.assertNotNull(response.body());
String respStr = response.body().string();
Assert.assertNotNull(respStr);
JSONObject jsonObject = (JSONObject) JSONValue.parse(respStr);
- System.out.println(respStr);
Assert.assertEquals(1, (long) jsonObject.get("code"));
String exception = (String) jsonObject.get("data");
Assert.assertTrue(exception.contains("table type is not OLAP"));
diff --git a/fe/fe-core/src/test/java/org/apache/doris/http/TableRowCountActionTest.java b/fe/fe-core/src/test/java/org/apache/doris/http/TableRowCountActionTest.java
index 6bb9e0a9cc..44b174b12d 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/http/TableRowCountActionTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/http/TableRowCountActionTest.java
@@ -39,8 +39,8 @@ public class TableRowCountActionTest extends DorisHttpTestCase {
.build();
Response response = networkClient.newCall(request).execute();
+ Assert.assertNotNull(response.body());
String res = response.body().string();
- System.out.println(res);
JSONObject jsonObject = (JSONObject) JSONValue.parse(res);
Assert.assertEquals(200, (long) ((JSONObject) jsonObject.get("data")).get("status"));
Assert.assertEquals(2000, (long) ((JSONObject) jsonObject.get("data")).get("size"));
diff --git a/fe/fe-core/src/test/java/org/apache/doris/load/routineload/KafkaProducerTest.java b/fe/fe-core/src/test/java/org/apache/doris/load/routineload/KafkaProducerTest.java
index 4e89a8ee37..893decdda0 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/load/routineload/KafkaProducerTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/load/routineload/KafkaProducerTest.java
@@ -53,12 +53,9 @@ public class KafkaProducerTest {
RecordMetadata metadata = kafkaProducer.send(record).get();
System.out.println("Record send with value " + value + " to partition "
+ metadata.partition() + " with offset " + metadata.offset());
- } catch (ExecutionException e) {
+ } catch (ExecutionException | InterruptedException e) {
System.out.println("Error in sending record " + value);
- System.out.println(e);
- } catch (InterruptedException e) {
- System.out.println("Error in sending record " + value);
- System.out.println(e);
+ e.printStackTrace();
}
i++;
}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/policy/PolicyTest.java b/fe/fe-core/src/test/java/org/apache/doris/policy/PolicyTest.java
index 27612dfb77..800b520836 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/policy/PolicyTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/policy/PolicyTest.java
@@ -213,7 +213,6 @@ public class PolicyTest extends TestWithFeService {
DataOutputStream output = new DataOutputStream(emptyOutputStream);
rowPolicy.write(output);
byte[] bytes = emptyOutputStream.toByteArray();
- System.out.println(emptyOutputStream.toString());
DataInputStream input = new DataInputStream(new ByteArrayInputStream(bytes));
Policy newPolicy = Policy.read(input);
diff --git a/fe/fe-core/src/test/java/org/apache/doris/qe/JournalObservableTest.java b/fe/fe-core/src/test/java/org/apache/doris/qe/JournalObservableTest.java
index 743cb0c811..d78b8ece6c 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/qe/JournalObservableTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/qe/JournalObservableTest.java
@@ -138,6 +138,5 @@ public class JournalObservableTest {
latch.countDown();
System.out.println(latch.getCount());
} // CHECKSTYLE IGNORE THIS LINE
- System.out.println("success");
}
}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/system/HeartbeatMgrTest.java b/fe/fe-core/src/test/java/org/apache/doris/system/HeartbeatMgrTest.java
index 9e28a57271..51a162e97e 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/system/HeartbeatMgrTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/system/HeartbeatMgrTest.java
@@ -175,7 +175,6 @@ public class HeartbeatMgrTest {
Assert.assertTrue(response instanceof BrokerHbResponse);
BrokerHbResponse hbResponse = (BrokerHbResponse) response;
- System.out.println(hbResponse.toString());
Assert.assertEquals(HbStatus.OK, hbResponse.getStatus());
}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/system/SystemInfoServiceTest.java b/fe/fe-core/src/test/java/org/apache/doris/system/SystemInfoServiceTest.java
index e8a5aa9bf2..2f9831b5e3 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/system/SystemInfoServiceTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/system/SystemInfoServiceTest.java
@@ -255,7 +255,6 @@ public class SystemInfoServiceTest {
beCounterMap.put(beId, beCounterMap.getOrDefault(beId, 0) + 1);
}
}
- System.out.println(beCounterMap);
List<Integer> list = Lists.newArrayList(beCounterMap.values());
Collections.sort(list);
int diff = list.get(list.size() - 1) - list.get(0);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org