HIVE-15535 : Flaky test : TestHS2HttpServer.testContextRootUrlRewrite (Barna Zsombor Klara via Ashutosh Chauhan)
Signed-off-by: Ashutosh Chauhan <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/9cccb955 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/9cccb955 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/9cccb955 Branch: refs/heads/hive-14535 Commit: 9cccb9556322275dd33bb4834034883d607c168c Parents: 566830f Author: Barna Zsombor Klara <[email protected]> Authored: Fri Mar 10 08:15:01 2017 -0800 Committer: Ashutosh Chauhan <[email protected]> Committed: Fri Mar 10 08:15:01 2017 -0800 ---------------------------------------------------------------------- .../test/org/apache/hive/service/server/TestHS2HttpServer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/9cccb955/service/src/test/org/apache/hive/service/server/TestHS2HttpServer.java ---------------------------------------------------------------------- diff --git a/service/src/test/org/apache/hive/service/server/TestHS2HttpServer.java b/service/src/test/org/apache/hive/service/server/TestHS2HttpServer.java index 351cfc1..4d50dd9 100644 --- a/service/src/test/org/apache/hive/service/server/TestHS2HttpServer.java +++ b/service/src/test/org/apache/hive/service/server/TestHS2HttpServer.java @@ -90,13 +90,16 @@ public class TestHS2HttpServer { @Test public void testContextRootUrlRewrite() throws Exception { + String datePattern = "[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]+\\[[0-9]+]"; + String dateMask = "xxxMasked_DateTime_xxx"; String baseURL = "http://localhost:" + webUIPort + "/"; String contextRootContent = getURLResponseAsString(baseURL); String jspUrl = "http://localhost:" + webUIPort + "/hiveserver2.jsp"; String jspContent = getURLResponseAsString(jspUrl); - Assert.assertEquals(contextRootContent, jspContent); + Assert.assertEquals(contextRootContent.replaceAll(datePattern, dateMask), + jspContent.replaceAll(datePattern, dateMask)); } @Test
