summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2022-08-01 12:18:30 +0200
committerMark Wielaard <mark@klomp.org>2022-08-01 12:18:30 +0200
commitbcd7651eb06f2e57a04ca97ae69b42c174fe3db3 (patch)
treed9f08d583fd0c26884233818105e74dd1536055b
parentd0ff4e224738adf34eba38dc33ffda67e5da6634 (diff)
downloadelfutils-bcd7651eb06f2e57a04ca97ae69b42c174fe3db3.tar.gz
tests: Add initial scan wait_ready in run-debuginfod-percent-escape.sh
Otherwise wait_ready for thread_work_total{role="traverse"} after the kill -USR1 can be either zero, one or two. We want to see it change to one first, then after the kill -USR1 it should change to two to be sure the scan happened after the new binary was created. Signed-off-by: Mark Wielaard <mark@klomp.org>
-rw-r--r--tests/ChangeLog4
-rwxr-xr-xtests/run-debuginfod-percent-escape.sh5
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index fb573d80..0c6f68ef 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-01 Mark Wielaard <mark@klomp.org>
+
+ * run-debuginfod-percent-escape.sh: Add initial scan wait_ready.
+
2022-04-28 Di Chen <dichen@redhat.com>
* run-readelf-Dd.sh: New test.
diff --git a/tests/run-debuginfod-percent-escape.sh b/tests/run-debuginfod-percent-escape.sh
index f7d8dc66..cd867427 100755
--- a/tests/run-debuginfod-percent-escape.sh
+++ b/tests/run-debuginfod-percent-escape.sh
@@ -34,7 +34,8 @@ tempfiles vlog$PORT1
errfiles vlog$PORT1
# Server must become ready
wait_ready $PORT1 'ready' 1
-# Be patient when run on a busy machine things might take a bit.
+# And initial scan should be done
+wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
# Build a non-stripped binary
echo "int main() { return 0; }" > ${PWD}/F/p++r\$\#o^^g.c
@@ -44,7 +45,7 @@ BUILDID=`env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../src/readelf \
tempfiles ${PWD}/F/p++r\$\#o^^g.c ${PWD}/F/p++r\$\#o^^g
kill -USR1 $PID1
# Now there should be 1 files in the index
-wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
+wait_ready $PORT1 'thread_work_total{role="traverse"}' 2
wait_ready $PORT1 'thread_work_pending{role="scan"}' 0
wait_ready $PORT1 'thread_busy{role="scan"}' 0
rm -rf $DEBUGINFOD_CACHE_PATH # clean it from previous tests