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

Tobias Nygren commented on SUREFIRE-1451:
-----------------------------------------

The following change solves the problem for me:
{code:diff}
diff --git 
a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
 
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
index 7c275845..2fc9f090 100644
--- 
a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
+++ 
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
@@ -55,7 +55,7 @@
     /**
      * The etime is in the form of [[dd-]hh:]mm:ss on Unix like systems.
      */
-    static final Pattern UNIX_CMD_OUT_PATTERN = compile( 
"^(((\\d+)-)?(\\d{2}):)?(\\d{2}):(\\d{2})$" );
+    static final Pattern UNIX_CMD_OUT_PATTERN = compile( 
"^(((\\d+)-)?(\\d{1,2}):)?(\\d{1,2}):(\\d{2})$" );

     private final long pluginPid;

{code}


> sureFire Booter compatibility with NetBSD ps(1) output
> ------------------------------------------------------
>
>                 Key: SUREFIRE-1451
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1451
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: process forking
>    Affects Versions: 2.20.1
>         Environment: NetBSD
>            Reporter: Tobias Nygren
>            Priority: Minor
>
> On NetBSD The /bin/ps command reports time as 0:01 rather than 00:01 for 
> intervals shorter than 10 minutes.
> The pattern as used [here in SureFire 
> Booter|https://github.com/apache/maven-surefire/commit/c343cc412b986fd9da839696c709542d03679d68#diff-33826e7c2cc48fb008e88914fd841d10R71]
>  to parse ps(1) output does not take this into account.
> printf(3) logic for ps(1) can be found in the [ps 
> source|https://github.com/NetBSD/src/blob/9160f3e067c6f959b9ecb4296771d8a6ae9b3ee6/bin/ps/print.c#L832].
> The following patterns are possible and need to be accounted for:
> * m:ss
> * mm:ss
> * h:mm:ss
> * hh:mm:ss
> * d-hh:mm:ss
> * dd-hh:mm:ss



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to