Re: Execution-time-sensitive timestamp regression tests

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Execution-time-sensitive timestamp regression tests
Дата
Msg-id 6232.1211686445@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Execution-time-sensitive timestamp regression tests  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> Objections, better ideas?

> Alternatively we could do a pg_sleep(.1) to sleep for 100ms. It sounds like
> the ideal would be something like:

> insert 'now'
> pg_sleep(.1)
> begin
> insert 'now'
> select * from table -- expect 1 (not 0 or 2)
> ... the other tests you mention which get bitten by midnight
> end

Roger, will do.

There actually still is a small risk in the sequence: if the BEGIN
block starts *exactly* at midnight, to within the resolution of
gettimeofday(), then 'now' and 'today' will yield the same value so
the expected row counts will not be matched.  This seems like an
acceptably small probability to me.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: \df displaying volatility
Следующее
От: "Gurjeet Singh"
Дата:
Сообщение: Does 'ALTER INDEX' take exclusive lock?