Skip to contentSkip to conversation

test: Make tests more resilient to changes in start-up performance

PATCH New [email protected] 1 participant 1 message Dec 10, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: Make tests more resilient to changes in start-up performance

From: Eugene Loh <[email protected]>

The tests with no target might start dtrace many times. The test time-out values should be long enough to withstand many starts even on slow test systems. Use time-out values for dtrace start-up times of as long as 10 seconds.

The tests with a target might start the target first and then expect more than one dtrace to start up and find that target. Make sure the target runs sufficiently long. Do not worry about making the target run too long, since the test will kill the target anyhow once it is no longer needed.

---
 test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh     | 2 +-
 test/unittest/dtrace-util/tst.ListProbesFunc.sh         | 4 +++-
 test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh     | 4 ++--
 test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh   | 4 ++--
 test/unittest/dtrace-util/tst.ListProbesName.sh         | 4 ++--
 test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh     | 4 ++--
 test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh | 4 ++--
 7 files changed, 14 insertions(+), 12 deletions(-)
test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh +1 -1
index 2184f2bbb..737f2cc88 100755
@@ -53,7 +53,7 @@ main(int argc, char **argv)
 	TEST_PROV_GO_DOUBLED(666, "foo");
 	TEST_PROV_GO_HALVED(666, "foo");
 	TEST_PROV_GO_VANISHING(666, "foo");
-	sleep(10);
+	sleep(1000); /* long sleep is okay; we kill the process when we no longer need it */
 }
 EOF
 
test/unittest/dtrace-util/tst.ListProbesFunc.sh +3 -1
index a311da217..b14aad2f5 100755
@@ -1,11 +1,13 @@
 #!/bin/bash
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
 # Licensed under the Universal Permissive License v 1.0 as shown at
 # http://oss.oracle.com/licenses/upl.
 #
 
+# @@timeout: 100
+
 ##
 #
 # ASSERTION:
test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh +2 -2
index 587b2ddfb..f8083f2c9 100755
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
 # Licensed under the Universal Permissive License v 1.0 as shown at
 # http://oss.oracle.com/licenses/upl.
 #
@@ -49,7 +49,7 @@ int
 main(int argc, char **argv)
 {
 	TEST_PROV_GO();
-	sleep(10);
+	sleep(1000); /* long sleep is okay; we kill the process when we no longer need it */
 }
 EOF
 
test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh +2 -2
index 1c5cc986e..dc6cb1008 100755
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
 # Licensed under the Universal Permissive License v 1.0 as shown at
 # http://oss.oracle.com/licenses/upl.
 #
@@ -49,7 +49,7 @@ int
 main(int argc, char **argv)
 {
 	TEST_PROV_GO();
-	sleep(10);
+	sleep(1000); /* long sleep is okay; we kill the process when we no longer need it */
 }
 EOF
 
test/unittest/dtrace-util/tst.ListProbesName.sh +2 -2
index 6fadf9482..4dd3cbcff 100755
@@ -1,12 +1,12 @@
 #!/bin/bash
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
 # Licensed under the Universal Permissive License v 1.0 as shown at
 # http://oss.oracle.com/licenses/upl.
 #
 
-# @@timeout: 90
+# @@timeout: 160
 
 ##
 #
test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh +2 -2
index 865e2d00e..59b8dca56 100755
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
 # Licensed under the Universal Permissive License v 1.0 as shown at
 # http://oss.oracle.com/licenses/upl.
 #
@@ -49,7 +49,7 @@ int
 main(int argc, char **argv)
 {
 	TEST_PROV_GO();
-	sleep(10);
+	sleep(1000); /* long sleep is okay; we kill the process when we no longer need it */
 }
 EOF
 
test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh +2 -2
index a5e9b8b97..64fc185da 100755
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
 # Licensed under the Universal Permissive License v 1.0 as shown at
 # http://oss.oracle.com/licenses/upl.
 #
@@ -49,7 +49,7 @@ int
 main(int argc, char **argv)
 {
 	TEST_PROV_GO();
-	sleep(10);
+	sleep(1000); /* long sleep is okay; we kill the process when we no longer need it */
 }
 EOF
 
Signature · 1 line
2.43.5