Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v1Ver-009P9J-4X for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Sep 2025 20:00:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v1Vep-00FUfv-TC for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Sep 2025 20:00:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v1Vep-00FUfF-H8 for pgsql-hackers@lists.postgresql.org; Wed, 24 Sep 2025 20:00:07 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v1Vel-002gXC-0x for pgsql-hackers@lists.postgresql.org; Wed, 24 Sep 2025 20:00:06 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-361d175c97fso1774631fa.3 for ; Wed, 24 Sep 2025 13:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758744002; x=1759348802; darn=lists.postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=JJV8mdIxvSOSpw/LLNFNq6WD7rj/TQZ/jgGJ032ul/k=; b=hn/UPitj11B04/OWkrifKW5Kn9YHMRK5pIPcMCkusTxISX4gyE/RgnQ93cOyHkx0XM kp4/ol5RPbPAPD/FTOOKsJhpeuLVh4RagJwE3ySS6wTLEzB3hhJFzrusFxzEF9SvIUxN ihiejHaBB6UF1W723A0gh0bLEgRNpW8WrcW9Qfo19ck0GHMeJEPCCRyY1zdBogIbrkDo SToQj/U6qrCrh7iC63RdG50BWvwVz8tLfRivsa9lKGsjG5wyKSXfxguQN9BPqf16ldtN Yrv7/g8p+m/ZoHL8AxNGgKBTknrKCo247BJrutFwaJRJDdYowZnfYejGTpSHmrsOk11i AMuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758744002; x=1759348802; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=JJV8mdIxvSOSpw/LLNFNq6WD7rj/TQZ/jgGJ032ul/k=; b=HRmd+Qdet0AIVGlaVTxMedjv9e0CBkGDf7+1vWV1SECEN601eD/xeTm7/0UlfAba9Z R/awEZ2+laY5OG09rNt8nXF/MixP2DWUvV3cDon1MA9Z6WDDmoBMUO71Bw/iBi7oiROd 9xfLEtyrRCQ0l9cNm8+Q4yhh6Zcq63yddp3ehNMxhnHvZbK1VIrzVLID+Dvwcc3RAwzo /5KbjC/sC25WWzItbB14PaKn10ihHMrmvYJ71/nT/Ce79ZEI45BsGqs3wH57u2LUd4hW 9oLk4bVvVm2FTTfli9WtM7SoEZ9wKhn0UObApkgPFnGPCnmsTEYb1J4CesFqtPSnAaRt hJkQ== X-Forwarded-Encrypted: i=1; AJvYcCV/I6IQ8n3Y4d6mMN1eE4OAOFrh7baawHOIuEGvA7t7YGmRWKYSvm88Bd4aFOE71Gd0W4F7ZCsDIfM49udo@lists.postgresql.org X-Gm-Message-State: AOJu0YwFPBw7TlltPWHsgQY371tSKGHh+p2X3cN7en7EMHMrh70D8djD m8vnY4TZK+TCeyNXxHHuYlHT6nD2CNkpStfPa/D5bAoLBFARiBdYF6wj X-Gm-Gg: ASbGnct3YKMusXuFUeDTU/qh5WkVelMe8n7A3daeTCuZG7tlmFtPFNg9FzzRdyL72fa 7/F6Muynnl5KUWajMPbsdrRkpSr2XY28cM2pPKa2W61KiWB0apUG6WIaQIcucCyrItO8X9VG+hz co4ifJHlyMaSp+sP+7ZU1LQTdEcERR5NFgIYvxjOKKFvAjknx8g+qo9ySd1Q3Wm6GnrjBRWAw8z Y90a4N1Ul0Dl/yS4cciJ9ZxfEahNgwb4DFJoYLa3EpPqEm3CedeKtU+V6hn7nm/mWi/X8lALPOp RnRfmdhh8QY60WkzZt0AvqTR6CDB1aqNaSpmyfCyFeYwuiWOnpryN3lOJ5SbSUaDtFbCrl7eZvi l6bQX6qUOOCC/7gNGEBp9/lF05Q== X-Google-Smtp-Source: AGHT+IFo0L7qt+wBlB1pbNA2kCOs357kcLpLPhIPC8QYSMLzbSFr+k5ONB8c9CwM/oqAKXNjca6G4A== X-Received: by 2002:a05:651c:1541:b0:363:f65f:ddcb with SMTP id 38308e7fff4ca-36f7d8c0278mr2164921fa.18.1758744002113; Wed, 24 Sep 2025 13:00:02 -0700 (PDT) Received: from [192.168.0.50] ([89.149.120.198]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-36fb7bfb868sm12591fa.54.2025.09.24.13.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Sep 2025 13:00:01 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------IgVUfDRvYhsvKC4HuBgA1j23" Message-ID: Date: Wed, 24 Sep 2025 23:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: GNU/Hurd portability patches To: Michael Banck , Tom Lane Cc: Michael Paquier , pgsql-hackers@lists.postgresql.org, Thomas Munro References: <68643ea2.050a0220.128f53.3f77@mx.google.com> <2874644f-6431-41f4-abe2-99e5ab052606@gmail.com> <68d0f931.050a0220.3185e0.19ae@mx.google.com> <283c3d69-ef32-4391-9ea3-68e47c9dea31@gmail.com> <68d3a0a0.050a0220.167290.bcf3@mx.google.com> <68d3cbe8.5d0a0220.65f10.da5f@mx.google.com> <3314741.1758724126@sss.pgh.pa.us> <68d413a3.a70a0220.24c74c.8be9@mx.google.com> Content-Language: en-US From: Alexander Lakhin In-Reply-To: <68d413a3.a70a0220.24c74c.8be9@mx.google.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------IgVUfDRvYhsvKC4HuBgA1j23 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 24.09.2025 18:52, Michael Banck wrote: > On Wed, Sep 24, 2025 at 10:28:46AM -0400, Tom Lane wrote: >> It seems plausible that the execution time of the stats >> test's function-under-test is so short that it sometimes >> doesn't register as more than zero on a machine with poor >> clock resolution. It looks like that test only calls the >> test function once or twice before checking that it's >> accumulated some runtime, and the test function is nothing >> more than >> >> CREATE FUNCTION test_stat_func() RETURNS VOID LANGUAGE plpgsql AS $$BEGIN END;$$; >> >> I'd call this a bug in that test TBH. It'd be saner to >> make the function do something like pg_sleep for 1ms. > I did that in the attached, so far my Hurd VM ran the stats test more > than 1000 times without a failure with it. I have the loop running till > 10000, I'll report back tomorrow. If the stats test could be fixed this way, I wonder how to deal with regress/subscription.sql. When running: TESTS="$(printf "subscription %.0s" `seq 1000`)" make -s check-tests on the same Hurd VM, I'm observing: ... ok 986       - subscription                               53 ms not ok 987   - subscription                               53 ms ok 988       - subscription                               53 ms ... # 4 of 1000 tests failed. # The differences that caused some tests to fail can be viewed in the file "/home/demo/postgresql/src/test/regress/regression.diffs". $ cat "/home/demo/postgresql/src/test/regress/regression.diffs" --- /home/demo/postgresql/src/test/regress/expected/subscription.out 2025-09-24 19:49:53.000000000 +0100 +++ /home/demo/postgresql/src/test/regress/results/subscription.out 2025-09-24 20:06:48.000000000 +0100 @@ -70,7 +70,7 @@  SELECT :'prev_stats_reset' < stats_reset FROM pg_stat_subscription_stats WHERE subname = 'regress_testsub';   ?column?  ---------- - t + f  (1 row)  -- fail - name already exists diff -U3 /home/demo/postgresql/src/test/regress/expected/subscription.out /home/demo/postgresql/src/test/regress/results/subscription.out --- /home/demo/postgresql/src/test/regress/expected/subscription.out 2025-09-24 19:49:53.000000000 +0100 +++ /home/demo/postgresql/src/test/regress/results/subscription.out 2025-09-24 20:07:13.000000000 +0100 @@ -70,7 +70,7 @@  SELECT :'prev_stats_reset' < stats_reset FROM pg_stat_subscription_stats WHERE subname = 'regress_testsub';   ?column?  ---------- - t + f  (1 row)  -- fail - name already exists diff -U3 /home/demo/postgresql/src/test/regress/expected/subscription.out /home/demo/postgresql/src/test/regress/results/subscription.out --- /home/demo/postgresql/src/test/regress/expected/subscription.out 2025-09-24 19:49:53.000000000 +0100 +++ /home/demo/postgresql/src/test/regress/results/subscription.out 2025-09-24 20:07:28.000000000 +0100 @@ -70,7 +70,7 @@  SELECT :'prev_stats_reset' < stats_reset FROM pg_stat_subscription_stats WHERE subname = 'regress_testsub';   ?column?  ---------- - t + f  (1 row)  -- fail - name already exists diff -U3 /home/demo/postgresql/src/test/regress/expected/subscription.out /home/demo/postgresql/src/test/regress/results/subscription.out --- /home/demo/postgresql/src/test/regress/expected/subscription.out 2025-09-24 19:49:53.000000000 +0100 +++ /home/demo/postgresql/src/test/regress/results/subscription.out 2025-09-24 20:07:33.000000000 +0100 @@ -70,7 +70,7 @@  SELECT :'prev_stats_reset' < stats_reset FROM pg_stat_subscription_stats WHERE subname = 'regress_testsub';   ?column?  ---------- - t + f  (1 row)  -- fail - name already exists Best regards, Alexander --------------IgVUfDRvYhsvKC4HuBgA1j23 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
24.09.2025 18:52, Michael Banck wrote:
On Wed, Sep 24, 2025 at 10:28:46AM -0400, Tom Lane wrote:
It seems plausible that the execution time of the stats
test's function-under-test is so short that it sometimes
doesn't register as more than zero on a machine with poor
clock resolution.  It looks like that test only calls the
test function once or twice before checking that it's
accumulated some runtime, and the test function is nothing
more than

    CREATE FUNCTION test_stat_func() RETURNS VOID LANGUAGE plpgsql AS $$BEGIN END;$$;

I'd call this a bug in that test TBH.  It'd be saner to
make the function do something like pg_sleep for 1ms.
I did that in the attached, so far my Hurd VM ran the stats test more
than 1000 times without a failure with it. I have the loop running till
10000, I'll report back tomorrow.

If the stats test could be fixed this way, I wonder how to deal with
regress/subscription.sql. When running:
TESTS="$(printf "subscription %.0s" `seq 1000`)" make -s check-tests

on the same Hurd VM, I'm observing:
...
ok 986       - subscription                               53 ms
not ok 987   - subscription                               53 ms
ok 988       - subscription                               53 ms
...
# 4 of 1000 tests failed.
# The differences that caused some tests to fail can be viewed in the file "/home/demo/postgresql/src/test/regress/regression.diffs".

$ cat "/home/demo/postgresql/src/test/regress/regression.diffs"

--- /home/demo/postgresql/src/test/regress/expected/subscription.out    2025-09-24 19:49:53.000000000 +0100
+++ /home/demo/postgresql/src/test/regress/results/subscription.out     2025-09-24 20:06:48.000000000 +0100
@@ -70,7 +70,7 @@
 SELECT :'prev_stats_reset' < stats_reset FROM pg_stat_subscription_stats WHERE subname = 'regress_testsub';
  ?column?
 ----------
- t
+ f
 (1 row)
 
 -- fail - name already exists
diff -U3 /home/demo/postgresql/src/test/regress/expected/subscription.out /home/demo/postgresql/src/test/regress/results/subscription.out
--- /home/demo/postgresql/src/test/regress/expected/subscription.out    2025-09-24 19:49:53.000000000 +0100
+++ /home/demo/postgresql/src/test/regress/results/subscription.out     2025-09-24 20:07:13.000000000 +0100
@@ -70,7 +70,7 @@
 SELECT :'prev_stats_reset' < stats_reset FROM pg_stat_subscription_stats WHERE subname = 'regress_testsub';
  ?column?
 ----------
- t
+ f
 (1 row)
 
 -- fail - name already exists
diff -U3 /home/demo/postgresql/src/test/regress/expected/subscription.out /home/demo/postgresql/src/test/regress/results/subscription.out
--- /home/demo/postgresql/src/test/regress/expected/subscription.out    2025-09-24 19:49:53.000000000 +0100
+++ /home/demo/postgresql/src/test/regress/results/subscription.out     2025-09-24 20:07:28.000000000 +0100
@@ -70,7 +70,7 @@
 SELECT :'prev_stats_reset' < stats_reset FROM pg_stat_subscription_stats WHERE subname = 'regress_testsub';
  ?column?
 ----------
- t
+ f
 (1 row)
 
 -- fail - name already exists
diff -U3 /home/demo/postgresql/src/test/regress/expected/subscription.out /home/demo/postgresql/src/test/regress/results/subscription.out
--- /home/demo/postgresql/src/test/regress/expected/subscription.out    2025-09-24 19:49:53.000000000 +0100
+++ /home/demo/postgresql/src/test/regress/results/subscription.out     2025-09-24 20:07:33.000000000 +0100
@@ -70,7 +70,7 @@
 SELECT :'prev_stats_reset' < stats_reset FROM pg_stat_subscription_stats WHERE subname = 'regress_testsub';
  ?column?
 ----------
- t
+ f
 (1 row)
 
 -- fail - name already exists


Best regards,
Alexander
--------------IgVUfDRvYhsvKC4HuBgA1j23--