From patchwork Sun Nov 19 14:11:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 80300 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21A133858401 for ; Sun, 19 Nov 2023 14:12:28 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id A5D5B3858D33 for ; Sun, 19 Nov 2023 14:12:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5D5B3858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A5D5B3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700403143; cv=none; b=ZAyg8i9ltfyPzxBPzJb7QUPYPbBtjxLNHEiMvAo/ULLqWZG853GzHeKvqNoYblKwvoEs9ax4QPXBdLR9zj4cckmSr/rYx5T6jawFsjhaRUAe0Gs+GZ/NVcIzqRXX/Y1btWlW3fNdnE7qK5mQA9YyjuluXUp86mmWfo74Y+k+BGQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700403143; c=relaxed/simple; bh=XUodGJjexT/W17J2odTsJZLtvpRA8oMDVhtwynN1CsE=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=xf9J5ENkotHMzBLG7Eb/RmgF3+xuYtOQeuhl2lm8n00tp8G489STJdW+ReRUQqfkweAIIOOrBx6ci95l0Y3nexCry+yQrVQSfxkHUaMyMSxW8BJUUOk+remaGSDif2E8MCdT1posoB2vdhnrr5EsxcDOtdzanlpXSE9yHHpI+ko= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from csb.redhat.com (deer0x03.wildebeest.org [172.31.17.133]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id C3A6730291AB; Sun, 19 Nov 2023 15:12:19 +0100 (CET) Received: by csb.redhat.com (Postfix, from userid 10916) id A5A9210AFC2; Sun, 19 Nov 2023 15:12:19 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH] tests: Restructure run-debuginfod-response-headers.sh Date: Sun, 19 Nov 2023 15:11:28 +0100 Message-Id: <20231119141128.2584112-1-mark@klomp.org> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Spam-Status: No, score=-3033.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_BADIPHTTP, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org run-debuginfod-response-headers.sh does occassionally fail because it might scan an rpm more than once. Try to fix this by making sure all files that debuginfod is supposed to scan are ready before the server starts. And to explicitly wait till the first scan is ready and done before testing 'scanned_files_total{source=".rpm archive"}' instead of sending an kill -USR1. Signed-off-by: Mark Wielaard --- tests/run-debuginfod-response-headers.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/run-debuginfod-response-headers.sh b/tests/run-debuginfod-response-headers.sh index fbb6a484..ea516ced 100755 --- a/tests/run-debuginfod-response-headers.sh +++ b/tests/run-debuginfod-response-headers.sh @@ -32,14 +32,6 @@ export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache base=9500 get_ports mkdir F R -env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -R -d $DB -p $PORT1 -t0 -g0 -v R F > vlog$PORT1 2>&1 & -PID1=$! -tempfiles vlog$PORT1 -errfiles vlog$PORT1 -# Server must become ready -wait_ready $PORT1 'ready' 1 -export DEBUGINFOD_URLS=http://127.0.0.1:$PORT1/ # or without trailing / -######################################################################## # Compile a simple program, strip its debuginfo and save the build-id. # Also move the debuginfo into another directory so that elfutils @@ -57,12 +49,25 @@ if [ "$zstd" = "false" ]; then # nuke the zstd fedora 31 ones rm -vrf R/debuginfod-rpms/fedora31 fi -kill -USR1 $PID1 +env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS= ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -R -d $DB -p $PORT1 -t0 -g0 -v R F > vlog$PORT1 2>&1 & +PID1=$! +tempfiles vlog$PORT1 +errfiles vlog$PORT1 +# Server must become ready +wait_ready $PORT1 'ready' 1 +export DEBUGINFOD_URLS=http://127.0.0.1:$PORT1/ # or without trailing / +######################################################################## + # Wait till both files are in the index and scan/index fully finished +wait_ready $PORT1 'ready' 1 wait_ready $PORT1 'thread_work_total{role="traverse"}' 1 +wait_ready $PORT1 'thread_work_pending{role="scan"}' 0 +wait_ready $PORT1 'thread_busy{role="scan"}' 0 + # All rpms need to be in the index, except the dummy permission-000 one rpms=$(find R -name \*rpm | grep -v nothing | wc -l) wait_ready $PORT1 'scanned_files_total{source=".rpm archive"}' $rpms + kill -USR1 $PID1 # two hits of SIGUSR1 may be needed to resolve .debug->dwz->srefs # Wait till both files are in the index and scan/index fully finished wait_ready $PORT1 'thread_work_total{role="traverse"}' 2