Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrQLa-0005tc-Lw for pgsql-general@arkaria.postgresql.org; Sat, 27 Jul 2019 17:19:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hrQLX-0001ma-Ks for pgsql-general@arkaria.postgresql.org; Sat, 27 Jul 2019 17:19:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrQLX-0001kO-Ac for pgsql-general@lists.postgresql.org; Sat, 27 Jul 2019 17:19:03 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrQLP-0004um-06 for pgsql-general@lists.postgresql.org; Sat, 27 Jul 2019 17:19:02 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 8A9672EA9; Sat, 27 Jul 2019 19:18:53 +0200 (CEST) Date: Sat, 27 Jul 2019 19:18:53 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Default ordering option Message-ID: <20190727171853.h3wmvmubrpbft3em@hjp.at> References: <98233546-f5a4-1786-4641-1d7be8d88bc2@2ndquadrant.com> <5fe04061-bb71-db46-afd7-8c510413c300@aklaver.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xishgem2z5ytwhqt" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --xishgem2z5ytwhqt Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-07-26 09:52:52 +0200, Cyril Champier wrote: > No, the code I pasted was an existing production bug: the=A0last_name > should have been unique, so the selected patient would always be the > same. This should have been detected in tests, but since the order was > "almost always the same", our test was green 99% of the time, so we > discarded it as flaky. >=20 > Fuzzy testing could be an option, but this would go too far, as for > Peter extension suggestion. We have huge existing codebase with more > than 10K tests, and I do not want to modify our whole testing > strategy. >=20 > Meanwhile, I went for an ORM patch (ActiveRecord) and forbid usages > that can workaround it. Another idea: How do ypu prepare your test data? Do you have a (possibly large) test database or do you populate a test database with test-specific data in a fixture? If you do the latter, you might be able insert the data in random order. hp --=20 _ | Peter J. Holzer | we build much bigger, better disasters now |_|_) | | because we have much more sophisticated | | | hjp@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson --xishgem2z5ytwhqt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAl08h3YACgkQ8g5IURL+ KF254g/+P9ZMSp/HtxTk7AkWwNxVq5CrYl69hF76UQIz/PlXWIT41FY9uZ4CBlIT BS8lgx+MAntLEQI1vyNqTmMZhcxAqtWaL9O9EEL3mYBtfLMyqGUkA3y2eVUfAegt W/09KPLF2hPtKYBnxXeJR7ZVWlxAH+hTKG6uWsDdsl+5ZRCeKKE0ZmApQXUiTvvd 21jUZSmrJqagxom6BElMqL2JheQwB2NfpYrtUA5m65xX4jZpwfyNR5SX4fjFMU/x lvvZWid6LeKwsY7Wj+hXkhNjEEq6FcJv55UyLlFY+UlI8khkBIT8nZq1AfMcQXAI egBpiSEahb9EP0yMa0P9yUNFy609fJV2fEghWGE4W01AjHqNzug+wEQa3GOFLMBT uIr7ns3Y1S2+UcheI/WBeYeNhJB5FgFps8pEiygtwinzqCQvm2GIVc1MwfXPJLZx CVbtx1YFtFqtW7+yxvIrxddjrf2hsUf+lzsJaQpJ/Wb92pyUuxjcTEV/hY+KRn7u p3cFwiuVU1LCDUEZ2YH9vDekMjnbJLg53zZcbLdhkM32igUhpFp4xZfALWhF7GSo QtBhU6EqWSxcJxFBgIZ8kSor5rn3c9mV+r4NoM7aeannUTM0qe28JbQN7mFTgddE 6m/7tmRJij7NAr9wfjoOZgBxHfxUc3In/KgVJD9IZXYjfOqnDcw= =Poux -----END PGP SIGNATURE----- --xishgem2z5ytwhqt--