]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Don't try to corrupt sqlite database during test.
authorMark Wielaard <mark@klomp.org>
Thu, 14 Apr 2022 11:26:57 +0000 (13:26 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 14 Apr 2022 11:26:57 +0000 (13:26 +0200)
In run-debuginfod-federation-sqlite.sh we used to try to corrupt
the sqlite database while the debuginfod server was running and
check it detected errors, but that was unreliably and slightly
dangerous since part of the database was already mapped into memory.
Instead trigger some some random activity, then trigger a shutdown.

Signed-off-by: Mark Wielaard <mark@klomp.org>
tests/ChangeLog
tests/run-debuginfod-federation-sqlite.sh

index 6cb0d64986bc4328b7c12ff79d2b4b20c3f900ba..e49bff0521087923bdfaa27b08e316ed42b7e748 100644 (file)
@@ -1,3 +1,8 @@
+2022-04-14  Mark Wielaard  <mark@klomp.org>
+
+       * run-debuginfod-federation-sqlite.sh: Don't try to corrupt
+       sqlite database.
+
 2022-04-13  Aaron Merey  <amerey@redhat.com>
 
        * Makefile.am (TESTS): Remove run-debuginfod-000-permission.sh
index bb3cda1293ce5fc769c1f7567ff4276267649da7..d93215266d33d63401642e46b3c50189e637823e 100755 (executable)
@@ -167,11 +167,11 @@ curl -s http://127.0.0.1:$PORT1/metrics | grep 'http_responses_after_you.*'
 # waiting.  A few hundred ms is typical on this developer's workstation.
 
 ########################################################################
-# Corrupt the sqlite database and get debuginfod to trip across its errors
-curl -s http://127.0.0.1:$PORT1/metrics | grep 'sqlite3.*reset'
-dd if=/dev/zero of=$DB bs=1 count=1
-
-# trigger some random activity that's Sure to get sqlite3 upset
+# Trigger some some random activity, then trigger a clean shutdown.
+# We used to try to corrupt the database while the debuginfod server
+# was running and check it detected errors, but that was unreliably
+# and slightly dangerous since part of the database was already mapped
+# into memory.
 kill -USR1 $PID1
 wait_ready $PORT1 'thread_work_total{role="traverse"}' 2
 wait_ready $PORT1 'thread_work_pending{role="scan"}' 0
@@ -179,14 +179,15 @@ wait_ready $PORT1 'thread_busy{role="scan"}' 0
 kill -USR2 $PID1
 wait_ready $PORT1 'thread_work_total{role="groom"}' 2
 curl -s http://127.0.0.1:$PORT1/buildid/beefbeefbeefd00dd00d/debuginfo > /dev/null || true
-curl -s http://127.0.0.1:$PORT1/metrics | grep 'error_count.*sqlite'
-# Run the tests again without the servers running. The target file should
-# be found in the cache.
 
 kill -INT $PID1 $PID2
 wait $PID1 $PID2
 PID1=0
 PID2=0
+
+# Run the tests again without the servers running. The target file should
+# be found in the cache.
+
 tempfiles .debuginfod_*
 
 testrun ${abs_builddir}/debuginfod_build_id_find -e F/prog 1