[JIRA] (JENKINS-49746) Regex returns more matches than it should if errors are close together

2018-03-16 Thread r.wilkin...@samsung.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Richard Wilkinson commented on  JENKINS-49746  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Regex returns more matches than it should if errors are close together   
 

  
 
 
 
 

 
 Yes, a parsed file which only returns the expected number of matches plus the additional lines following the last expected match, the 5th match in this case. So your output looks exactly as I'd expect.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49746) Regex returns more matches than it should if errors are close together

2018-03-01 Thread r.wilkin...@samsung.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Richard Wilkinson commented on  JENKINS-49746  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Regex returns more matches than it should if errors are close together   
 

  
 
 
 
 

 
 See the attached file, err.txt.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49746) Regex returns more matches than it should if errors are close together

2018-03-01 Thread r.wilkin...@samsung.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Richard Wilkinson updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49746  
 
 
  Regex returns more matches than it should if errors are close together   
 

  
 
 
 
 

 
Change By: 
 Richard Wilkinson  
 
 
Attachment: 
 err.txt  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49746) Regex returns more matches than it should if errors are close together

2018-02-26 Thread r.wilkin...@samsung.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Richard Wilkinson created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49746  
 
 
  Regex returns more matches than it should if errors are close together   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 David van Laatum  
 
 
Components: 
 email-ext-plugin  
 
 
Created: 
 2018-02-26 15:26  
 
 
Environment: 
 Jenkins version 2.89.4  email-ext-plugin version 2.61   
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Richard Wilkinson  
 

  
 
 
 
 

 
 Some of our tests return huge error files if the log file being parsed has matching errors that are closer together than the setting for "linesAfter". This is true even if "maxMatches" is set to just 1. Our setting in email-ext-plugin is:   ${BUILD_LOG_REGEX, regex="(?m)^(nc\\w+:\\s+\\*E,|.\\bNG\\b|\\s*Errorb|E-).$", linesBefore=5, linesAfter=10, maxMatches=5, showTruncatedLines=false}   so this should limit the number of errors returned to 5. However, because the gap between matched errors is less than 10 lines this means that (in the Java code) the number of lines remaining to be written out gets reset to 10 on every subsequent match. The break condition for exiting the regex is the the number of lines remaining is 0 (amongst others) but this never happens for this case.   This can be fixed by modifying BuildLogRegexContent.java on line 291. Change this line to: if (matched & (numMatches < maxMatches)) and this will properly limit the number of matches to the value specified in numMatches and allow the regex to complete correctly.