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

vars/pgrep_proc.groovy
vars/pkill_proc.groovy
jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
--------------------------------------------------
  o Re-home pgrep_proc and pkill_proc inlined code blocks
    into standalone vars/ scripts.
  o Cleanup npm-groovy-warnings.
  o Add banners in {pgrep,pkill} to help diagnose the silent
    exception reported during job runs yesterday.

Change-Id: I73644b748139612b32ce2dd56e5a97c04eb5cac0
diff --git a/edit.sh b/edit.sh
deleted file mode 100755
index fbea2d7..0000000
--- a/edit.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-# args+=('--quick')
-emacs ./jjb/pipeline/voltha/{master,voltha-2.12}/bbsim-tests.groovy
diff --git a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
index 1f82010..f26eb5a 100644
--- a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
@@ -234,6 +234,7 @@
 	    println("${iam}: Shutdown process $proc")
 	    pgrep_proc(proc)
 	    pkill_proc(proc)
+	    pgrep_proc(proc)
 	    println("${iam}: LEAVE")
         }
 
@@ -271,6 +272,7 @@
       fi
       ps aux | grep port-forward
       """
+
         script {
 	    String proc = 'port-forward'
 
@@ -576,11 +578,14 @@
 		println("${iam}: ENTER")
 
                 def tests = readYaml text: testTargets
+                println("** [DEBUG]: tests=$tests")
 
 		String buffer = []    
 		tests.eachWithIndex { test, idx ->
 		    String  target = test['target']
+		    println(" ** Build test index [$idx]: target=$target")
 		    buffer.add("      test[${idx}]: ${target}\n")
+		    println("** buffer contains: $buffer")
 	        }
 
 		println("** Testing index: tests-to-run")
@@ -588,8 +593,9 @@
 		println('''
 ** -----------------------------------------------------------------------
 ** NOTE: For odd/silent job failures verify a few details
-**   - All tests mentioned in the index have been processed.
+**   - All tests mentioned in the tests-to-run index were logged.
 **   - Test suites display ENTER/LEAVE mesasge pairs.
+**   - Processing terminated prematurely when LEAVE strings are missing.
 ** -----------------------------------------------------------------------
 ''')
 		tests.eachWithIndex { test, idx ->
diff --git a/vars/pgrep_proc.groovy b/vars/pgrep_proc.groovy
index bf6fa9a..1ad5dfc 100644
--- a/vars/pgrep_proc.groovy
+++ b/vars/pgrep_proc.groovy
@@ -37,7 +37,11 @@
     String cmdFull = "pgrep --list-full '${proc}'"
     String cmd = """if [[ \$(pgrep --count "${proc}") -gt 0 ]]; then ${cmdFull}; fi"""
 
-    println(" ** Running: ${cmd}")
+    print("""
+** -----------------------------------------------------------------------
+** Running: $cmd
+** -----------------------------------------------------------------------
+""")
     sh(
         label  : 'pgrep_proc', // jenkins usability: label log entry 'step'
         script : "${cmd}",
diff --git a/vars/pkill_proc.groovy b/vars/pkill_proc.groovy
index 54d58ad..753a1f1 100644
--- a/vars/pkill_proc.groovy
+++ b/vars/pkill_proc.groovy
@@ -36,7 +36,13 @@
 
     String cmdKill = "pkill --echo '${proc}'"
     String cmd = """if [[ \$(pgrep --count "${proc}") -gt 0 ]]; then ${cmdKill}; fi"""
-    println(" ** Running: ${cmd}")
+
+    print("""
+** -----------------------------------------------------------------------
+** Running: $cmd
+** -----------------------------------------------------------------------
+""")
+
     sh(
         label  : 'pkill_proc', // jenkins usability: label log entry 'step'
         script : "${cmd}",