mukund-thakur commented on a change in pull request #1991:
URL: https://github.com/apache/hadoop/pull/1991#discussion_r427052757
##########
File path:
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsStatistics.java
##########
@@ -200,41 +215,29 @@ public void testOpenAppendRenameExists() throws
IOException {
Path createFilePath = path(getMethodName());
Path destCreateFilePath = path(getMethodName() + "New");
- Map<String, Long> metricMap = fs.getInstrumentation().toMap();
-
- //Tests for initial values of counters before any method is called.
- assertEquals("Mismatch in op_open", 0,
- (long) metricMap.get("op_open"));
- assertEquals("Mismatch in op_append", 0,
- (long) metricMap.get("op_append"));
- assertEquals("Mismatch in op_rename", 0,
- (long) metricMap.get("op_rename"));
- assertEquals("Mismatch in op_exists", 0,
- (long) metricMap.get("op_exists"));
-
fs.create(createFilePath);
fs.open(createFilePath);
fs.append(createFilePath);
fs.rename(createFilePath, destCreateFilePath);
- metricMap = fs.getInstrumentation().toMap();
+ Map<String, Long> metricMap = fs.getInstrumentation().toMap();
//Testing single method calls to open, append and rename.
- assertEquals("Mismatch in op_open", 1,
- (long) metricMap.get("op_open"));
- assertEquals("Mismatch in op_append", 1,
- (long) metricMap.get("op_append"));
- assertEquals("Mismatch in op_rename", 1,
- (long) metricMap.get("op_rename"));
+ assertEquals("Mismatch in " + openOp, 1,
+ (long) metricMap.get(openOp));
+ assertEquals("Mismatch in " + appendOp, 1,
+ (long) metricMap.get(appendOp));
+ assertEquals("Mismatch in " + renameOp, 1,
+ (long) metricMap.get(renameOp));
//Testing if file exists at path.
- assertTrue("Mismatch in file Path existing",
+ assertTrue("File should exist",
Review comment:
put filename in the message.
##########
File path:
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsStatistics.java
##########
@@ -200,41 +215,29 @@ public void testOpenAppendRenameExists() throws
IOException {
Path createFilePath = path(getMethodName());
Path destCreateFilePath = path(getMethodName() + "New");
- Map<String, Long> metricMap = fs.getInstrumentation().toMap();
-
- //Tests for initial values of counters before any method is called.
- assertEquals("Mismatch in op_open", 0,
- (long) metricMap.get("op_open"));
- assertEquals("Mismatch in op_append", 0,
- (long) metricMap.get("op_append"));
- assertEquals("Mismatch in op_rename", 0,
- (long) metricMap.get("op_rename"));
- assertEquals("Mismatch in op_exists", 0,
- (long) metricMap.get("op_exists"));
-
fs.create(createFilePath);
fs.open(createFilePath);
fs.append(createFilePath);
fs.rename(createFilePath, destCreateFilePath);
- metricMap = fs.getInstrumentation().toMap();
+ Map<String, Long> metricMap = fs.getInstrumentation().toMap();
//Testing single method calls to open, append and rename.
- assertEquals("Mismatch in op_open", 1,
- (long) metricMap.get("op_open"));
- assertEquals("Mismatch in op_append", 1,
- (long) metricMap.get("op_append"));
- assertEquals("Mismatch in op_rename", 1,
- (long) metricMap.get("op_rename"));
+ assertEquals("Mismatch in " + openOp, 1,
+ (long) metricMap.get(openOp));
+ assertEquals("Mismatch in " + appendOp, 1,
+ (long) metricMap.get(appendOp));
+ assertEquals("Mismatch in " + renameOp, 1,
+ (long) metricMap.get(renameOp));
//Testing if file exists at path.
- assertTrue("Mismatch in file Path existing",
+ assertTrue("File should exist",
fs.exists(destCreateFilePath));
- assertFalse("Mismatch in file Path existing", fs.exists(createFilePath));
+ assertFalse("File should not exist", fs.exists(createFilePath));
Review comment:
put filename in the message.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]