From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2aaPKDGdu2p1EhcAWB0awg (envelope-from ) for ; Tue, 29 Sep 2026 07:12:49 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=fsJcUrRJ; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=VHK9+1Kl; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=AlgMSp+w; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=4MPFxJCX; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A20FF1E06B; Tue, 29 Sep 2026 07:12:49 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id DD9AD1E033 for ; Tue, 29 Sep 2026 07:12:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0EBE44BB3B9A for ; Tue, 29 Sep 2026 11:12:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0EBE44BB3B9A Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=fsJcUrRJ; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=VHK9+1Kl; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=AlgMSp+w; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=4MPFxJCX Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id CCC524BB24C1 for ; Tue, 29 Sep 2026 11:09:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CCC524BB24C1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CCC524BB24C1 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790680173; cv=none; b=l/CKWwJTLTlFVcR3xQB+nkf2zF5OgeX+G7yTjrgXm8RkBVzX07F/LYLHzy9+tKqZO66VMwAY2hB6wbw4O0hkrAuSM8cPqrALuRqYXJbqtt3CIuLKcUrobBcVPpe5YETIu+q4wUfd+TGh3kQKU4nNGwoEB16HhjUBj+nCGSrU9iQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790680173; c=relaxed/simple; bh=FCYHXfZ82biqgR2R1pC3wdBUn+W+kR9ZKY5dQ5l8yHI=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=iAX3AL4fLzbYjXiekvrDdLbR757Nu2CAXLG1gTln+UlTiK3BImGJpJC9c1mu4IcS2UMMs42g91Nga9XceM563AkCPdnktrxR5n746RA3Jmw7Zomt+9bOTGHXenGgMBILslW6bfG6YH5kzQyUXGF/ePy9XHwucg3MpnzFwmqTOhM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=fsJcUrRJ; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=VHK9+1Kl; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=AlgMSp+w; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=4MPFxJCX DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCC524BB24C1 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A72481F7BE for ; Tue, 29 Sep 2026 11:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790680168; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8HAkrRxhutcWhn4hjD6KoMKBJX3Z8he0G9TqB18Ex5c=; b=fsJcUrRJkVzikchEHDaQ2/GUObUQdbjPAWmMP2t4EAFAbyrcZpH38/2UE+prN3eRqmohIq xJBb4J98QxWz9ghwoLRjEeAB2atnPZ9N56swI1ViwzigWa+ef6rim614kfkgbkurCAWbT9 w70/YYw5KMHGJta+xFVZGCrIPcuGwX0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790680168; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8HAkrRxhutcWhn4hjD6KoMKBJX3Z8he0G9TqB18Ex5c=; b=VHK9+1Kl4ZCViBIzv7d8XADgdaNeSI3RX6nEf68AugkxJhWaZAIiQ1AcaRjaX3iN5NQxsn BQHVxE/t+7SIfNBg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790680164; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8HAkrRxhutcWhn4hjD6KoMKBJX3Z8he0G9TqB18Ex5c=; b=AlgMSp+w2aPDRGXO8uAvK2hxlLT2JOtzezr6bGjGRiqM/erKf36HXR8lS1Yb7hj+9NxBoU VzK4Mv0YqQefT4cJ9oTwlfLcEU/gKGWCO4UlZ1inc7peFODZK2cJUe/eovAE00U9ezT8Oa bKEdTnudLcwDkntaHay1S5ahMhR8bg0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790680164; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8HAkrRxhutcWhn4hjD6KoMKBJX3Z8he0G9TqB18Ex5c=; b=4MPFxJCXc/MtpDu1o2NoJJJy28CzjLmEYEvDzZlhBbuEiEkBg1XweuYUj4M5jeVy/HPZ+Y 9vqZeQX1muXiu/BA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 993D01377F for ; Tue, 29 Sep 2026 11:09:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id jiAQNGGcu2oIAgAAD6G6ig:T6 (envelope-from ) for ; Tue, 29 Sep 2026 11:09:22 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH v2 6/6] [gdb/testsuite] Extend gdb.testsuite/lock.exp a bit more Date: Tue, 29 Sep 2026 13:09:21 +0200 Message-ID: <20260929110921.1910094-6-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260929110921.1910094-1-tdevries@suse.de> References: <20260929110921.1910094-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-1.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.992]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org The test-case gdb.testsuite/lock.exp contains a lock taken scenario, but it's timing dependent, so while it's probable that the scenario is tested, is not guaranteed. Fix this by adding a scenario where we use the on_retry parameter to release the lock. --- gdb/testsuite/gdb.testsuite/lock.exp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gdb/testsuite/gdb.testsuite/lock.exp b/gdb/testsuite/gdb.testsuite/lock.exp index 51859cb80db..9815dc25bbb 100644 --- a/gdb/testsuite/gdb.testsuite/lock.exp +++ b/gdb/testsuite/gdb.testsuite/lock.exp @@ -66,3 +66,26 @@ with_test_prefix "on retry return" { lock_file_release $res gdb_assert {![file exists $lockfile]} "Release lock" } + +# Scenario 4: +# - acquire 1 +# - acquire 2 fails. On retry, release 1. Acquire 2 succeeds. +# - release 2 +with_test_prefix "on retry unlock" { + set res [lock_file_acquire $lockfile] + gdb_assert {[file exists $lockfile]} "Acquire lock" + + proc on_retry {} { + lock_file_release $::res + return 1 + } + + # Try to acquire the lock. That should fail. + # Then on retry, release the lock. + # The next try to acquire the lock should succeed. + set res2 [lock_file_acquire $lockfile on_retry] + gdb_assert {[file exists $lockfile]} "Re-acquire lock" + + lock_file_release $res2 + gdb_assert {![file exists $lockfile]} "Release lock" +} -- 2.51.0