[ 
https://issues.apache.org/jira/browse/OOZIE-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15097419#comment-15097419
 ] 

Robert Kanter commented on OOZIE-2429:
--------------------------------------

A few things:
# I think we're wrapping too much in the {{if}} statement added to 
{{CoordActionUpdateXCommand}}.  We're interested in the call to 
{{generateEvent}} here, right?  But the code is also doing a few other things 
like updating the last modified time, etc.  I think it's safer to add the check 
for {{formerCoordinatorStatus}} and {{formerCoordinatorPending}} just around 
the {{generateEvent}} call.  For instance:
{code:java}
if (EventHandlerService.isEnabled() && (formerCoordinatorStatus != 
coordAction.getStatus() || formerCoordinatorPending != 
coordAction.getPending())) {
                generateEvent(coordAction, coordJob.getUser(), 
coordJob.getAppName(), workflow.getStartTime());
} else {
   Log...
}
{code}
# In the {{else}} block, I think we should (a) make it a debug level message 
and (b) make the message itself a little more clear (the grammar is a little 
funny).  How about {{LOG.debug("No event generated because Coordinator Action 
\[\{0\}\]'s status \[\{1\}\] and pending \[\{2\}\] have not changed", 
coordAction.getId(), coordAction.getStatus(), coordAction.getPending());}}
# A number of the log messages in {{CoordActionUpdateXCommand}} are using 
String concatenation instead of the "\{#\}" formatting.  Can you fix these 
while we're here?  For an example, see what I did above.  The "\[" and "\]" are 
not necessary for it to work, but we typically do that to indicate that the 
value was filled in.
# Instead of commenting out {{//final WorkflowJobGetJPAExecutor readCmd2 = new 
WorkflowJobGetJPAExecutor(jobId1);}} in the test, you can just delete it.

> 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
>
>
> TestEventGeneration's testForNoDuplicates fails tome to time depending on the 
> circumstances of the test.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to