VOL-5155 - triage failure in periodic-voltha-test-bbsim-2.12

jjb/pipeline/voltha/master/bbsim-tests.groovy
jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
--------------------------------------------------
  o Enough with GString variables and inability to natively cast to java.String()
  o Just hardcode the pgrep/pkill commands for now and figure out library problems later.

Change-Id: I7d7fe693d2b910da789f8d868a02ea01bb5fd415
diff --git a/jjb/pipeline/voltha/master/bbsim-tests.groovy b/jjb/pipeline/voltha/master/bbsim-tests.groovy
index 4530de8..f71e75e 100644
--- a/jjb/pipeline/voltha/master/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/master/bbsim-tests.groovy
@@ -129,13 +129,30 @@
             timeout(5) {
                 script {
                     enter('Cleanup')
+
                     // remove orphaned port-forward from different namespaces
-                    String proc = 'kubectl .*port-forward' // was 'port-forw'
+                    String proc = 'kubectl.*port-forward' // was 'port-forw'
+                    /*
                     pgrep_proc(proc)
                     pkill_proc(proc)
+                    pgrep_proc(proc) // todo: fatal unless (proc count==0)
+                     */
 
-                    // todo: fatal unless (proc count==0)
-                    pgrep_proc(proc)
+                    sh(label  : 'pgrep_proc - kill-pre',
+                       script : """
+pgrep --uid "$(uid -u)" --list-full --full 'kubectl.*port-forward'
+""")
+
+                    sh(label  : 'pkill_proc - kubectl.*port-forward',
+                       script : """
+pkill --uid "$(uid -u)" --echo --full 'kubectl.*port-forward'
+""")
+
+                    sh(label  : 'pgrep_proc - kill-post',
+                       script : """
+pgrep --uid "$(uid -u)" --list-full --full 'kubectl.*port-forward'
+""")
+
                     leave('Cleanup')
                 } // script
             } // timeout
@@ -259,9 +276,27 @@
 
                     println("${iam}: ENTER")
                     println("${iam}: Shutdown process $proc")
+                    /*
                     pgrep_proc(proc)
                     pkill_proc(proc)
                     pgrep_proc(proc)
+                     */
+
+                    sh(label  : 'pgrep_proc - kill-pre',
+                       script : """
+pgrep --uid "$(uid -u)" --list-full --full '_TAG=kail-startup'
+""")
+
+                    sh(label  : 'pkill_proc - _TAG=kail-startup',
+                       script : """
+pkill --uid "$(uid -u)" --echo --full '_TAG=kail-startup'
+""")
+
+                    sh(label  : 'pgrep_proc - kill-post',
+                       script : """
+pgrep --uid "$(uid -u)" --list-full --full '_TAG=kail-startup'
+""")
+                    
                     println("${iam}: LEAVE")
                 }
 
@@ -306,7 +341,10 @@
                 // String proc = 'kubectl.*port-forward' // was 'port-forward'
                 String proc = 'port-forward'
                 println("Display spawned ${proc}")
-                pgrep_proc(proc)
+                sh(label  : 'pgrep_proc - check',
+                   script : """
+pgrep --uid "$(uid -u)" --list-full --full "port-forward"
+""")
                 leave('port-forward check')
             }
 
@@ -439,8 +477,24 @@
 
     script {
         println("${iam}: ENTER")
+        /*
         pgrep_proc('kail-startup')
         pkill_proc('kail')
+         */
+        sh(label  : 'pgrep_proc - kill-pre',
+           script : """
+pgrep --uid "$(uid -u)" --list-full --full "kail-startup',
+""")
+        sh(label  : 'pkill_proc - kail',
+           script : """
+pkill --uid "$(uid -u)" --echo --full 'kail'
+""")
+
+        sh(label  : 'pgrep_proc - kill-post',
+           script : """
+pgrep --uid "$(uid -u)" --list-full --full 'kail'
+""")
+        
         println("${iam}: LEAVE")
     }
 
@@ -666,4 +720,4 @@
     }
 } // pipeline
 
-// [EOF] - 2
+// [EOF]
diff --git a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
index 3909c4e..389d428 100644
--- a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
@@ -129,13 +129,30 @@
             timeout(5) {
                 script {
                     enter('Cleanup')
+
                     // remove orphaned port-forward from different namespaces
-                    String proc = 'kubectl .*port-forward' // was 'port-forw'
+                    String proc = 'kubectl.*port-forward' // was 'port-forw'
+                    /*
                     pgrep_proc(proc)
                     pkill_proc(proc)
+                    pgrep_proc(proc) // todo: fatal unless (proc count==0)
+                     */
 
-                    // todo: fatal unless (proc count==0)
-                    pgrep_proc(proc)
+                    sh(label  : 'pgrep_proc - kill-pre',
+                       script : """
+pgrep --uid "$(uid -u)" --list-full --full 'kubectl.*port-forward'
+""")
+
+                    sh(label  : 'pkill_proc - kubectl.*port-forward',
+                       script : """
+pkill --uid "$(uid -u)" --echo --full 'kubectl.*port-forward'
+""")
+
+                    sh(label  : 'pgrep_proc - kill-post',
+                       script : """
+pgrep --uid "$(uid -u)" --list-full --full 'kubectl.*port-forward'
+""")
+
                     leave('Cleanup')
                 } // script
             } // timeout
@@ -259,9 +276,27 @@
 
                     println("${iam}: ENTER")
                     println("${iam}: Shutdown process $proc")
+                    /*
                     pgrep_proc(proc)
                     pkill_proc(proc)
                     pgrep_proc(proc)
+                     */
+
+                    sh(label  : 'pgrep_proc - kill-pre',
+                       script : """
+pgrep --uid "$(uid -u)" --list-full --full '_TAG=kail-startup'
+""")
+
+                    sh(label  : 'pkill_proc - _TAG=kail-startup',
+                       script : """
+pkill --uid "$(uid -u)" --echo --full '_TAG=kail-startup'
+""")
+
+                    sh(label  : 'pgrep_proc - kill-post',
+                       script : """
+pgrep --uid "$(uid -u)" --list-full --full '_TAG=kail-startup'
+""")
+                    
                     println("${iam}: LEAVE")
                 }
 
@@ -306,7 +341,10 @@
                 // String proc = 'kubectl.*port-forward' // was 'port-forward'
                 String proc = 'port-forward'
                 println("Display spawned ${proc}")
-                pgrep_proc(proc)
+                sh(label  : 'pgrep_proc - check',
+                   script : """
+pgrep --uid "$(uid -u)" --list-full --full "port-forward"
+""")
                 leave('port-forward check')
             }
 
@@ -439,8 +477,24 @@
 
     script {
         println("${iam}: ENTER")
+        /*
         pgrep_proc('kail-startup')
         pkill_proc('kail')
+         */
+        sh(label  : 'pgrep_proc - kill-pre',
+           script : """
+pgrep --uid "$(uid -u)" --list-full --full "kail-startup',
+""")
+        sh(label  : 'pkill_proc - kail',
+           script : """
+pkill --uid "$(uid -u)" --echo --full 'kail'
+""")
+
+        sh(label  : 'pgrep_proc - kill-post',
+           script : """
+pgrep --uid "$(uid -u)" --list-full --full 'kail'
+""")
+        
         println("${iam}: LEAVE")
     }
 
@@ -637,6 +691,7 @@
 ** Executing test ${target} on workflow ${workflow} with logging ${testLogging} and extra flags ${flags}
 ** -----------------------------------------------------------------------
 """)
+
                         try {
                             enter("execute_test (target=$target)")
                             execute_test(target, workflow, testLogging, teardown, flags)
@@ -665,4 +720,4 @@
     }
 } // pipeline
 
-// [EOF] - 2
+// [EOF]