1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >Test Evaluation</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
15 TITLE="Regression Tests"
16 HREF="regress.html"><LINK
18 TITLE="Regression Tests"
19 HREF="regress.html"><LINK
21 TITLE="Platform-specific comparison files"
22 HREF="regress-platform.html"><LINK
25 HREF="stylesheet.css"><META
27 CONTENT="2003-12-22T03:48:47"></HEAD
33 SUMMARY="Header navigation table"
43 >PostgreSQL 7.4.1 Documentation</TH
67 >Chapter 26. Regression Tests</TD
81 HREF="regress-platform.html"
95 NAME="REGRESS-EVALUATION"
96 >26.2. Test Evaluation</A
99 > Some properly installed and fully functional
107 > some of these regression tests due to
108 platform-specific artifacts such as varying floating-point representation
109 and time zone support. The tests are currently evaluated using a simple
113 > comparison against the outputs
114 generated on a reference system, so the results are sensitive to
115 small system differences. When a test is reported as
119 >, always examine the differences between
120 expected and actual results; you may well find that the
121 differences are not significant. Nonetheless, we still strive to
122 maintain accurate reference files across all supported platforms,
123 so it can be expected that all tests pass.
126 > The actual outputs of the regression tests are in files in the
129 >src/test/regress/results</TT
130 > directory. The test
134 > to compare each output
135 file against the reference outputs stored in the
138 >src/test/regress/expected</TT
140 differences are saved for your inspection in
143 >src/test/regress/regression.diffs</TT
148 > yourself, if you prefer.)
156 >26.2.1. Error message differences</A
159 > Some of the regression tests involve intentional invalid input
160 values. Error messages can come from either the
164 > code or from the host
165 platform system routines. In the latter case, the messages may
166 vary between platforms, but should reflect similar
167 information. These differences in messages will result in a
171 > regression test that can be validated by
181 >26.2.2. Locale differences</A
184 > If you run the tests against an already-installed server that was
185 initialized with a collation-order locale other than C, then
186 there may be differences due to sort order and follow-up
187 failures. The regression test suite is set up to handle this
188 problem by providing alternative result files that together are
189 known to handle a large number of locales. For example, for the
193 > test, the expected file
208 locales. The regression test driver will automatically pick the
209 best file to match against when checking for success and for
210 computing failure differences. (This means that the regression
211 tests cannot detect whether the results are appropriate for the
212 configured locale. The tests will simply pick the one result
213 file that works best.)
216 > If for some reason the existing expected files do not cover some
217 locale, you can add a new file. The naming scheme is
228 The actual digit is not significant. Remember that the
229 regression test driver will consider all such files to be equally
230 valid test results. If the test results are platform-specific,
231 the technique described in <A
232 HREF="regress-platform.html"
235 should be used instead.
244 >26.2.3. Date and time differences</A
247 > A few of the queries in the <TT
251 fail if you run the test on the day of a daylight-saving time
252 changeover, or the day after one. These queries expect that
253 the intervals between midnight yesterday, midnight today and
254 midnight tomorrow are exactly twenty-four hours --- which is wrong
255 if daylight-saving time went into or out of effect meanwhile.
264 > Because USA daylight-saving time rules are used, this problem always
265 occurs on the first Sunday of April, the last Sunday of October,
266 and their following Mondays, regardless of when daylight-saving time
267 is in effect where you live. Also note that the problem appears or
268 disappears at midnight Pacific time (UTC-7 or UTC-8), not midnight
269 your local time. Thus the failure may appear late on Saturday or
270 persist through much of Tuesday, depending on where you live.
275 > Most of the date and time results are dependent on the time zone
276 environment. The reference files are generated for time zone
280 > (Berkeley, California), and there will be apparent
281 failures if the tests are not run with that time zone setting.
282 The regression test driver sets environment variable
290 ensures proper results. However, your operating system must provide
294 > time zone, or the time zone-dependent
295 tests will fail. To verify that your machine does have this
296 support, type the following:
299 >env TZ=PST8PDT date</PRE
301 The command above should have returned the current system time in
305 > time zone. If the <TT
308 > time zone is not available,
309 then your system may have returned the time in UTC. If the
313 > time zone is missing, you can set the time zone
316 CLASS="PROGRAMLISTING"
317 >PGTZ='PST8PDT7,M04.01.0,M10.05.03'; export PGTZ</PRE
321 > There appear to be some systems that do not accept the
322 recommended syntax for explicitly setting the local time zone
323 rules; you may need to use a different <TT
327 setting on such machines.
330 > Some systems using older time-zone libraries fail to apply
331 daylight-saving corrections to dates before 1970, causing
335 > times to be displayed in <ACRONYM
339 result in localized differences in the test results.
348 >26.2.4. Floating-point differences</A
351 > Some of the tests involve computing 64-bit floating-point numbers (<TT
355 >) from table columns. Differences in
356 results involving mathematical functions of <TT
360 > columns have been observed. The <TT
367 > tests are particularly prone to small differences
368 across platforms, or even with different compiler optimization options.
369 Human eyeball comparison is needed to determine the real
370 significance of these differences which are usually 10 places to
371 the right of the decimal point.
374 > Some systems display minus zero as <TT
384 > Some systems signal errors from <CODE
391 > differently from the mechanism
392 expected by the current <SPAN
405 >26.2.5. Row ordering differences</A
408 >You might see differences in which the same rows are output in a
409 different order than what appears in the expected file. In most cases
410 this is not, strictly speaking, a bug. Most of the regression test
411 scripts are not so pedantic as to use an <TT
418 >, and so their result row orderings are not well-defined
419 according to the letter of the SQL specification. In practice, since we are
420 looking at the same queries being executed on the same data by the same
421 software, we usually get the same result ordering on all platforms, and
425 > isn't a problem. Some queries do exhibit
426 cross-platform ordering differences, however. (Ordering differences
427 can also be triggered by non-C locale settings.)
430 >Therefore, if you see an ordering difference, it's not something to
431 worry about, unless the query does have an <TT
435 is violating. But please report it anyway, so that we can add an
439 > to that particular query and thereby eliminate the bogus
443 > in future releases.
446 >You might wonder why we don't order all the regression test queries explicitly to
447 get rid of this issue once and for all. The reason is that that would
448 make the regression tests less useful, not more, since they'd tend
449 to exercise query plan types that produce ordered results to the
450 exclusion of those that don't.
465 > There is at least one case in the <TT
469 script that is intended to produce random results. This causes
470 random to fail the regression test once in a while (perhaps once
471 in every five to ten trials). Typing
473 CLASS="PROGRAMLISTING"
474 >diff results/random.out expected/random.out</PRE
476 should produce only one or a few lines of differences. You need
477 not worry unless the random test always fails in repeated
478 attempts. (On the other hand, if the random test is
485 > reported to fail even in many trials
486 of the regression tests, you probably <SPAN
502 SUMMARY="Footer navigation table"
531 HREF="regress-platform.html"
541 >Regression Tests</TD
555 >Platform-specific comparison files</TD