From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: X-Spam-Status: No, score=1.5 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,LIST_MIRROR_RECEIVED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.6 Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::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 dcvr.yhbt.net (Postfix) with ESMTPS id 0782B1F406 for ; Wed, 18 Oct 2023 18:32:42 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=ttaylorr-com.20230601.gappssmtp.com header.i=@ttaylorr-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=vOFoyREu; dkim-atps=neutral Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A464D281E94 for ; Wed, 18 Oct 2023 18:32:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2D56450D9; Wed, 18 Oct 2023 18:32:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ttaylorr-com.20230601.gappssmtp.com header.i=@ttaylorr-com.20230601.gappssmtp.com header.b="vOFoyREu" Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A43DD42C09 for ; Wed, 18 Oct 2023 18:32:33 +0000 (UTC) Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BB7611F for ; Wed, 18 Oct 2023 11:32:32 -0700 (PDT) Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3b2e44c7941so949328b6e.2 for ; Wed, 18 Oct 2023 11:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ttaylorr-com.20230601.gappssmtp.com; s=20230601; t=1697653951; x=1698258751; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qHGvlxqX2by4ndqlsFmQygviptCt2EfeSZBDIB5dfdU=; b=vOFoyREu+jM4oWOxpa9SinOJxtgWHXpqCXSlC5KChpKb8NLLUK7XdAzPoVHAvxeziZ Qg122lSNjwnGBVmXr14FdYSWHBW7EcNEwSolOzuEfsj9exmLCCsQ1TtjMrkWKFAmJUrT zGHz/weViWXqzGc4I2eVoGie/liovbrLDSYdbb1MPC1ZEn8AkLEIIYpp5fY9r+u99fQZ LFmVJtjM6fBAdIKoM9V9Ib4m5/mi1ckKIyO0uwRd9HWVkxBT9uLmzFZ2wwlGzHx4id/G b+Rd+0i0Dad0a87FpY7gxPkfCQy+PhCvOrrD1dzJ/+lTAdJR9GhisQQPv5uuKmJPBrEx 5MAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697653951; x=1698258751; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qHGvlxqX2by4ndqlsFmQygviptCt2EfeSZBDIB5dfdU=; b=Jc/E6F15ZBe3WQiBRs8jnr6+SmF/YQE61/FcOuW9RxRZgJ/9rSVngDzr2XHnGZqYQF yUHFhqm9cGSAB56ngmWOOlPOoly2QAnLJ6f2OSN0OkNQSuzNoXX/R+2RzFWytfNh4pP6 FrLVX8QNxIrevpsehpzdBu0H+LVlsX4ndz5+OEZxcTB0d8ofPu3ke0FB0wFwnTD13qeK naE0zHCa06oj5+kq6BJTvbz+XwpoyS2wpBqXXxLH1+SunZ2f4dkYC3y/v71RAjwhdfH5 o2NZIrZlST9iycOupqY0nMnL9hKIz47hwH/XdoZTUEhMesHPnJ7Ba6EtVhX7j4cexKn5 +5FQ== X-Gm-Message-State: AOJu0YzIWZ801kUO1STPb74urbOvJ4fFoyUb9JahkA0h/hJdeCkhonFu p3EMzeRWoAxb/6e+sg/2RYz18uMy2BxeM8KGJp7L/g== X-Google-Smtp-Source: AGHT+IGKpTRfLFIZ/pzAhThwr5/ToqPtf4Zo8K1820lofn6QvJ6FYlau+9aueOMX3dC0DTWfWyqP0w== X-Received: by 2002:a05:6808:df2:b0:3b2:e5b7:7869 with SMTP id g50-20020a0568080df200b003b2e5b77869mr5544oic.17.1697653951346; Wed, 18 Oct 2023 11:32:31 -0700 (PDT) Received: from localhost (104-178-186-189.lightspeed.milwwi.sbcglobal.net. [104.178.186.189]) by smtp.gmail.com with ESMTPSA id z14-20020a0cf24e000000b0066d1e71e515sm141674qvl.113.2023.10.18.11.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:32:30 -0700 (PDT) Date: Wed, 18 Oct 2023 14:32:29 -0400 From: Taylor Blau To: git@vger.kernel.org Cc: Elijah Newren , "Eric W. Biederman" , Jeff King , Junio C Hamano , Patrick Steinhardt Subject: [PATCH v4 01/17] t/t4216-log-bloom.sh: harden `test_bloom_filters_not_used()` Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Unsubscribe-Post: List-Unsubscribe=One-Click The existing implementation of test_bloom_filters_not_used() asserts that the Bloom filter sub-system has not been initialized at all, by checking for the absence of any data from it from trace2. In the following commit, it will become possible to load Bloom filters without using them (e.g., because `commitGraph.changedPathVersion` is incompatible with the hash version with which the commit-graph's Bloom filters were written). When this is the case, it's possible to initialize the Bloom filter sub-system, while still not using any Bloom filters. When this is the case, check that the data dump from the Bloom sub-system is all zeros, indicating that no filters were used. Signed-off-by: Taylor Blau --- t/t4216-log-bloom.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh index fa9d32facf..487fc3d6b9 100755 --- a/t/t4216-log-bloom.sh +++ b/t/t4216-log-bloom.sh @@ -81,7 +81,19 @@ test_bloom_filters_used () { test_bloom_filters_not_used () { log_args=$1 setup "$log_args" && - ! grep -q "statistics:{\"filter_not_present\":" "$TRASH_DIRECTORY/trace.perf" && + + if grep -q "statistics:{\"filter_not_present\":" "$TRASH_DIRECTORY/trace.perf" + then + # if the Bloom filter system is initialized, ensure that no + # filters were used + data="statistics:{" + data="$data\"filter_not_present\":0," + data="$data\"maybe\":0," + data="$data\"definitely_not\":0," + data="$data\"false_positive\":0}" + + grep -q "$data" "$TRASH_DIRECTORY/trace.perf" + fi && test_cmp log_wo_bloom log_w_bloom } -- 2.42.0.415.g8942f205c8