Re: Default ordering option - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Default ordering option
Date
Msg-id 20190727171853.h3wmvmubrpbft3em@hjp.at
Whole thread Raw
In response to Re: Default ordering option  (Cyril Champier <cyril.champier@doctolib.com>)
List pgsql-general
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/>

Attachment

pgsql-general by date:

Previous
From: Arya F
Date:
Subject: Re: Hardware for writing/updating 12,000,000 rows per hour
Next
From: Andres Freund
Date:
Subject: Re: Why does backend send buffer size hardcoded at 8KB?