verifyOnAllSubDirsHelper() in TestHDFSIntegrationBase.java has a bug. When the number of failed retries exceeds max value (the "else" portion of "if (retry > 0)" statement, it erroneously assigns hasSucceeded = true. It means that verifyOnAllSubDirsHelper() never returns false.
Once the problem was fixed in a local development branch, several tests in TestHDFSIntegrationAdvanced.java started failing. TestHDFSIntegrationEnd2End tests are still ok.
Also, it is unfortunate that TestHDFSIntegrationBase() returns boolean instead of throwing the original AssertionError which contains information about expected vs. found ACL permissions - this information is invaluable for debugging. The fix is easy - the to-be-fixed "else" portion is inside the "catch (Throwable th)" clause, so it should just re-throw caught exception. This makes "hasSucceeded" variable unnecessary - verifyOnAllSubDirsHelper() should have "void" return type.
The same problem exists in verifyQuery(), also in TestHDFSIntegrationBase.java. The "else" clause of "if (retry > 0)" also assigns "isSucceeded = true;" leading to the same problem - it never fails. Suggested solution would be the same - just re-throw the exception. It will not only fix the problem, but also make debugging easier. Current code "Assert.assertTrue(isSucceeded);" throws away valuable information about the expected vs detected number of database rows.
|Port SENTRY-1471 to sentry-ha-redesign||Resolved|