Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqvvt-0000AV-7h for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Apr 2016 05:04:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aqvvs-00032o-M3 for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Apr 2016 05:04:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqvuW-0001Y3-Cf for pgsql-hackers@postgresql.org; Fri, 15 Apr 2016 05:03:16 +0000 Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aqvuP-0007G5-3p; Fri, 15 Apr 2016 05:03:15 +0000 Received: by mail-vk0-x235.google.com with SMTP id c4so134753569vkb.3; Thu, 14 Apr 2016 22:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=TLcMLm4+LJfhc87a4lRamlU7+U57rwXhM43yNPWxo9k=; b=GzBCHwi3hvbxRdp3tHVljCqU4HXjhMeDq6Eau8XCvxS1dE6RZGK1RwgRmarSV54Iq2 x4C8pn5CxtJl5I6levOcx3OiYcXvABpRsiYf6zUTrhu45LMbNFk0BJYPCFAVf0I5cmDZ KFg1nMXzmiN9YxmlMof253Zo4iblQw0eLpdduh3wBfg0i+Xqw10xE/b7XlqTJiEIeqgW Hus1+V53eqAF2/VK98YrsJgfogni8howajjYW1h/DifMf3Vlxiby6Ev+N7xpDfKU2qkT JYdCNVmnYKiZomo/ruZDXCXrivpaWJB2RmDSbEuRHPQ4EQHZr3AgA/SzHnq7XkgEzmFb wd7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=TLcMLm4+LJfhc87a4lRamlU7+U57rwXhM43yNPWxo9k=; b=dsAF6bsJUAp6XkITnOCgRK9yZWErcINQZ5FB9hP/Ce5vWu80ogyNUHYAipceW257y8 fpmm2Nt0RRJHbwBTTXE0mVNXcCYzzy+eAA1FxapIxkF9V/rLmu031JhjDkP/LMhL76Pv zwPkcaIViQjOYZJg7PJ/nYK/Wm5tPPyhSRNTTSsnhDGc2LF0cvZGXF4LQ+sTVDn86Gwb 8s4EnnrOZg40EzTJwHimFMFDBfMCGas55cIj4htK97ah/apfeUxWd4LTVqOygR9lfwzT lB2Cm9FbH8neIgP3Do6RNZD6Wy3w319HuayhqbQ28tbXDFKCieyOkJSih96S3VVaPotl dSQQ== X-Gm-Message-State: AOPr4FUTtHMZ4bElwSd7tElT0iebrxU7GMkiHnst0X9vi9as4a7aVUHWzSBZYPo/5J0YLQn2CNFAv/DsbCZ10Q== MIME-Version: 1.0 X-Received: by 10.176.1.5 with SMTP id 5mr9400813uak.72.1460696588132; Thu, 14 Apr 2016 22:03:08 -0700 (PDT) Received: by 10.159.34.21 with HTTP; Thu, 14 Apr 2016 22:03:08 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Apr 2016 14:03:08 +0900 Message-ID: Subject: Re: [COMMITTERS] pgsql: Add regression tests for multiple synchronous standbys. From: Fujii Masao To: Michael Paquier Cc: Masahiko Sawada , Fujii Masao , PostgreSQL mailing lists Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Fri, Apr 15, 2016 at 1:12 PM, Michael Paquier wrote: > On Fri, Apr 15, 2016 at 12:57 PM, Fujii Masao wrote: >> On Fri, Apr 15, 2016 at 12:39 PM, Michael Paquier >> wrote: >>> On Fri, Apr 15, 2016 at 12:16 PM, Fujii Masao wrote: >>>> On Thu, Apr 14, 2016 at 8:41 PM, Michael Paquier >>>> wrote: >>>>> On Thu, Apr 14, 2016 at 5:17 PM, Masahiko Sawada wrote: >>>>>> On Thu, Apr 14, 2016 at 1:22 PM, Michael Paquier >>>>>> wrote: >>>>>>> Yes. I'd prefer avoid a hardcoded sleep and have something that relies >>>>>>> on lookups of pg_stat_replication though, because there is no way to >>>>>>> be sure that a sleep will ever be stable on heavily loaded machines, >>>>>>> like the machines I am specialized in maintaining :) >>>>>>> It kills a bit the purpose on having checks on pg_stat_replication as >>>>>>> the validation tests are based on that, still I think that we had >>>>>>> better base those checks on a loop that has a timeout, something like >>>>>>> that in a subroutine: >>>>>>> What do you think? >>>>>> >>>>>> Look good to me. +1. >>>> >>>> +1 from me. >>>> >>>>> And so here we go... >>>> >>>> + ok($test_passed, $msg); >>>> >>>> ISTM that this change prevents the test from outputting the difference >>>> of expected and actual results when the test fails. Which would make >>>> the diagnosis of the test failure more difficult, I'm afraid. >>> >>> Well, then, it is just a matter of saving the result in a variable >>> defined out of the loop, and use is() for the test. This way, after >>> the timeout it is possible to check if the expected result and the >>> fetched result match properly or not. In other words see attached. >> >> The patch looks good to me. >> >> + my $timeout_max = 30; >> >> One comment is; isn't 30 (seconds) too large value for the timeout? >> What about just, say, 5? > > hamster can become easily quite busy to be honest. Okay, since the test would fail very rarely (I hope), probably we can live with 30 seconds timeout (it happens only when the test fails). I pushed your latest patch. Thanks! Regards, -- Fujii Masao -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers