summaryrefslogtreecommitdiff
path: root/tests/run-debuginfod-fd-prefetch-caches.sh
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2021-09-09 21:51:51 +0200
committerMark Wielaard <mark@klomp.org>2021-09-09 22:53:05 +0200
commitbbf0dc0162e82770f296b2ecda77a2b5bd6f7405 (patch)
treea906b556d2b96df60b448c129521f1a240116a68 /tests/run-debuginfod-fd-prefetch-caches.sh
parentb561b51a472779a083f4b109b9821bc7963a6ff4 (diff)
downloadelfutils-bbf0dc0162e82770f296b2ecda77a2b5bd6f7405.tar.gz
tests: Don't fail run-debuginfod-fd-prefetch-caches.sh if grep -c fails
The set -o errtrace made run-debuginfod-fd-prefetch-caches.sh fail. On some systems. Add set -o functrace to make it fail consistently. The failure is because the grep -c for in the log file fails (it returns zero). Fix this by using || true. But this is only a workaround. It makes the test pass, but only because all values are always zero. The test doesn't currently test anything. Also make sure that err and cleanup are only executed once. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'tests/run-debuginfod-fd-prefetch-caches.sh')
-rwxr-xr-xtests/run-debuginfod-fd-prefetch-caches.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/run-debuginfod-fd-prefetch-caches.sh b/tests/run-debuginfod-fd-prefetch-caches.sh
index 61fee9e9..7fbf7b20 100755
--- a/tests/run-debuginfod-fd-prefetch-caches.sh
+++ b/tests/run-debuginfod-fd-prefetch-caches.sh
@@ -51,10 +51,14 @@ grep 'prefetch fds ' vlog$PORT1 #$PREFETCH_FDS
grep 'prefetch mbs ' vlog$PORT1 #$PREFETCH_MBS
# search the vlog to find what metric counts should be and check the correct metrics
# were incrimented
-wait_ready $PORT1 'fdcache_op_count{op="enqueue"}' $( grep -c 'interned.*front=1' vlog$PORT1 )
-wait_ready $PORT1 'fdcache_op_count{op="evict"}' $( grep -c 'evicted a=.*' vlog$PORT1 )
-wait_ready $PORT1 'fdcache_op_count{op="prefetch_enqueue"}' $( grep -c 'interned.*front=0' vlog$PORT1 )
-wait_ready $PORT1 'fdcache_op_count{op="prefetch_evict"}' $( grep -c 'evicted from prefetch a=.*front=0' vlog$PORT1 || true )
+enqueue_nr=$(grep -c 'interned.*front=1' vlog$PORT1 || true)
+wait_ready $PORT1 'fdcache_op_count{op="enqueue"}' $enqueue_nr
+evict_nr=$(grep -c 'evicted a=.*' vlog$PORT1 || true)
+wait_ready $PORT1 'fdcache_op_count{op="evict"}' $evict_nr
+prefetch_enqueue_nr=$(grep -c 'interned.*front=0' vlog$PORT1 || true)
+wait_ready $PORT1 'fdcache_op_count{op="prefetch_enqueue"}' $prefetch_enqueue_nr
+prefetch_evict_nr=$(grep -c 'evicted from prefetch a=.*front=0' vlog$PORT1 || true)
+wait_ready $PORT1 'fdcache_op_count{op="prefetch_evict"}' $prefetch_evict_nr
kill $PID1
wait $PID1