Version-Release number of selected component (if applicable): 3.4 Description of problem: Rest test intermittent failure in jenkins. == Regression org.zanata.rest.service.TranslationResourceRestTest.headersAfterTranslating (from TestSuite) Failing for the past 1 build (Since #1838 ) Took 0.19 sec. Error Message Expected: is "Administrator <root@localhost>" but: was "" Stacktrace java.lang.AssertionError: Expected: is "Administrator <root@localhost>" but: was "" at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8) at org.zanata.rest.service.TranslationResourceRestTest.headersAfterTranslating(TranslationResourceRestTest.java:914) == Also, this test contains asserting for-loops which are not appropriate in tests, for safety and readability. In this particular case if the collection is empty, or the headers don't match, the test will pass which is incorrect. There are several instances of the same code behaviour in the above class, which should be altered to something like for (HeaderEntry entry : header.getEntries()) { somehashmap.put(entry.getKey(), entry.getValue.trim()) } assertThat(somehashmap.get(HeaderFields.KEY_LastTranslator), is("Administrator <root@localhost>")); assertThat(somehashmap.get(HeaderFields.KEY_PoRevisionDate).length(), greaterThan(0)); The behaviour of the above cannot otherwise be properly verified.
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-380