pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Default ordering option
Date: Sat, 27 Jul 2019 19:18:53 +0200
Message-ID: <20190727171853.h3wmvmubrpbft3em@hjp.at> (raw)
In-Reply-To: <CAJaA8Vcemtt4yhJTk-Wtvj94ZpPLziMKDfzv4S_Ma5dGnAfhPw@mail.gmail.com>
References: <CAJaA8VcZCkBZeEMt45g-YR7c6ScHbB3PNURt6Z7AWZuuvX5umA@mail.gmail.com>
	<98233546-f5a4-1786-4641-1d7be8d88bc2@2ndquadrant.com>
	<CAJaA8VfVBQ1X+ggm5zO7BUFcvXvY0t+8_M+Ei94t=xKFCLHwow@mail.gmail.com>
	<5fe04061-bb71-db46-afd7-8c510413c300@aklaver.com>
	<CAJaA8Vcemtt4yhJTk-Wtvj94ZpPLziMKDfzv4S_Ma5dGnAfhPw@mail.gmail.com>

On 2019-07-26 09:52:52 +0200, Cyril Champier wrote:
> No, the code I pasted was an existing production bug: the last_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.
> 
> 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.
> 
> 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

-- 
   _  | 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 <https://www.edge.org/;

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (16+ messages)

Message-ID: <20190727171853.h3wmvmubrpbft3em@hjp.at>
Permalink:  ../20190727171853.h3wmvmubrpbft3em@hjp.at/
Also on:    postgresql.org/message-id/20190727171853.h3wmvmubrpbft3em@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Default ordering option
  In-Reply-To: <20190727171853.h3wmvmubrpbft3em@hjp.at>
  References: <CAJaA8VcZCkBZeEMt45g-YR7c6ScHbB3PNURt6Z7AWZuuvX5umA@mail.gmail.com> <98233546-f5a4-1786-4641-1d7be8d88bc2@2ndquadrant.com> <CAJaA8VfVBQ1X+ggm5zO7BUFcvXvY0t+8_M+Ei94t=xKFCLHwow@mail.gmail.com> <5fe04061-bb71-db46-afd7-8c510413c300@aklaver.com> <CAJaA8Vcemtt4yhJTk-Wtvj94ZpPLziMKDfzv4S_Ma5dGnAfhPw@mail.gmail.com> <20190727171853.h3wmvmubrpbft3em@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox