[ https://issues.apache.org/jira/browse/OOZIE-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15205606#comment-15205606 ]
Robert Kanter commented on OOZIE-2429: -------------------------------------- Two minor things on the amendment patch: - With {code} + HashMap<AppType,JobEvent> eventsMap = new HashMap<>(); + for (int i=0; i<3; ++i){ + JobEvent event = (JobEvent) queue.poll(); + eventsMap.put(event.getAppType(), event); + } + + assertEquals(3, eventsMap.size()); {code} The for loop shouldn't assume 3 items. If there are less, then {{queue.poll()}} will throw an Exception. If there are more, then the {{assertEquals}} statement won't catch it. It should loop through all items in {{queue}}. The {{assertEquals}} will ensure that we only have the expected 3 items. - I don't think we need the curly brace enclosures > TestEventGeneration test is flakey > ---------------------------------- > > Key: OOZIE-2429 > URL: https://issues.apache.org/jira/browse/OOZIE-2429 > Project: Oozie > Issue Type: Bug > Components: action, tests > Affects Versions: trunk > Reporter: Ferenc Denes > Assignee: Ferenc Denes > Priority: Minor > Fix For: trunk > > Attachments: OOZIE-2429-1.patch, OOZIE-2429-2.patch, > OOZIE-2429-3.patch, OOZIE-2429-3.patch, OOZIE-2429-addendum-1.patch > > > TestEventGeneration's testForNoDuplicates fails time to time depending on the > circumstances of the test. -- This message was sent by Atlassian JIRA (v6.3.4#6332)