Description
Exception exclusion functionality is not working correctly because of that tests are failing by not matching the error count.
I debugged the issue and found that the problem with shell command which is generating in the getNumberOfMatchesInLogFile function.
Currently building the shell command in the following way.
if(list != null){
for(int i =0; i < list.length; ++i)
}
String[] cmd =
new String[] {
"bash",
"-c",
"grep -c "
+ pattern + " " + filePattern
+ " | awk -F: '
However, The above commnad won't work correctly because you are counting the exceptions in the file before excluding the known exceptions.
In this case it gives the mismatch error counts everytime.The shell command should be in the following way to work correctly.
if (list != null) {
int index = 0;
for (String excludeExp : list) { filePattern.append((++index < list.length)? "| grep -v " : "| grep -vc " + list[i] ); }
}
String[] cmd =
new String[] {
"bash",
"-c",
"grep "
+ pattern + " " + filePattern
+ " | awk -F: '{s+=$2}
END
{print s}'" };
Attachments
Attachments
Issue Links
- depends upon
-
HADOOP-6332 Large-scale Automated Test Framework
-
- Closed
-