From e8f4d5aa0b5de7a9703f88b6ee09ebb541995f0a Mon Sep 17 00:00:00 2001
From: Ali Omar Abdelazim Mohammed <mohammal@uan01-nmn.local>
Date: Mon, 23 Aug 2021 11:38:19 -0500
Subject: [PATCH] add wiat pm in pm tests

---
 tests/check_ecmwf_attr.sh.in       | 2 ++
 tests/check_ecmwf_events.sh.in     | 2 ++
 tests/check_ecmwf_handle.sh.in     | 2 ++
 tests/check_pm_declare.sh.in       | 2 ++
 tests/check_pm_declare_group.sh.in | 2 ++
 tests/check_pm_interlock.sh.in     | 2 ++
 tests/check_subscribe.sh.in        | 2 ++
 7 files changed, 14 insertions(+)

diff --git a/tests/check_ecmwf_attr.sh.in b/tests/check_ecmwf_attr.sh.in
index 4bda7eb4..f3c64e1b 100755
--- a/tests/check_ecmwf_attr.sh.in
+++ b/tests/check_ecmwf_attr.sh.in
@@ -34,6 +34,8 @@ terminate () {
     # will make it receive a SIGPIPE eventually, which initiates
     # termination.
     exec 3<&-
+    echo "waiting pm to terminate"
+    wait ${PM_PID}
     exit ${2:-99}
 }
 
diff --git a/tests/check_ecmwf_events.sh.in b/tests/check_ecmwf_events.sh.in
index be6e74f6..13c7feb7 100755
--- a/tests/check_ecmwf_events.sh.in
+++ b/tests/check_ecmwf_events.sh.in
@@ -34,6 +34,8 @@ terminate () {
     # will make it receive a SIGPIPE eventually, which initiates
     # termination.
     exec 3<&-
+    echo "waiting pm to terminate"
+    wait ${PM_PID}
     exit ${2:-99}
 }
 
diff --git a/tests/check_ecmwf_handle.sh.in b/tests/check_ecmwf_handle.sh.in
index 707ac2ea..85dca88c 100755
--- a/tests/check_ecmwf_handle.sh.in
+++ b/tests/check_ecmwf_handle.sh.in
@@ -34,6 +34,8 @@ terminate () {
     # will make it receive a SIGPIPE eventually, which initiates
     # termination.
     exec 3<&-
+    echo "waiting pm to terminate"
+    wait ${PM_PID}
     exit ${2:-99}
 }
 
diff --git a/tests/check_pm_declare.sh.in b/tests/check_pm_declare.sh.in
index 4488871c..3f95b4ef 100644
--- a/tests/check_pm_declare.sh.in
+++ b/tests/check_pm_declare.sh.in
@@ -60,6 +60,8 @@ terminate () {
     # will make it receive a SIGPIPE eventually, which initiates
     # termination.
     exec 3<&-
+    echo "waiting pm to terminate"
+    wait ${PM_PID}
     exit ${2:-99}	       
 }
 
diff --git a/tests/check_pm_declare_group.sh.in b/tests/check_pm_declare_group.sh.in
index 8adee5d4..b7a26fd4 100644
--- a/tests/check_pm_declare_group.sh.in
+++ b/tests/check_pm_declare_group.sh.in
@@ -58,6 +58,8 @@ terminate () {
     # will make it receive a SIGPIPE eventually, which initiates
     # termination.
     exec 3<&-
+    echo "waiting pm to terminate"
+    wait ${PM_PID}
     exit ${2:-99}	       
 }
 
diff --git a/tests/check_pm_interlock.sh.in b/tests/check_pm_interlock.sh.in
index a91f052b..ef57e83f 100644
--- a/tests/check_pm_interlock.sh.in
+++ b/tests/check_pm_interlock.sh.in
@@ -64,6 +64,8 @@ terminate () {
     # will make it receive a SIGPIPE eventually, which initiates
     # termination.
     exec 3<&-
+    echo "waiting pm to terminate"
+    wait ${PM_PID}
     exit ${2:-99}	       
 }
 
diff --git a/tests/check_subscribe.sh.in b/tests/check_subscribe.sh.in
index 811f1a55..5d733ded 100644
--- a/tests/check_subscribe.sh.in
+++ b/tests/check_subscribe.sh.in
@@ -65,6 +65,8 @@ terminate () {
     # will make it receive a SIGPIPE eventually, which initiates
     # termination.
     exec 3<&-
+    echo "waiting pm to terminate"
+    wait ${PM_PID}
     exit ${2:-99}	       
 }
 
-- 
GitLab