Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > c87b2b497674629a1400410f06a9ef63 > files > 351

postgresql-docs-7.3.2-5mdk.ppc.rpm

<HTML
><HEAD
><TITLE
>Test Evaluation</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.73
"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 7.3.2 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Regression Tests"
HREF="regress.html"><LINK
REL="PREVIOUS"
TITLE="Running the Tests"
HREF="regress-run.html"><LINK
REL="NEXT"
TITLE="Platform-specific comparison files"
HREF="regress-platform.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
NAME="creation"
CONTENT="2003-02-03T20:17:34"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PostgreSQL 7.3.2 Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="regress-run.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 13. Regression Tests</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="regress-platform.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="REGRESS-EVALUATION"
>13.3. Test Evaluation</A
></H1
><P
>    Some properly installed and fully functional
    <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> installations can
    <SPAN
CLASS="QUOTE"
>"fail"</SPAN
> some of these regression tests due to
    platform-specific artifacts such as varying floating-point representation
    and time zone support. The tests are currently evaluated using a simple
    <SPAN
CLASS="APPLICATION"
>diff</SPAN
> comparison against the outputs
    generated on a reference system, so the results are sensitive to
    small system differences.  When a test is reported as
    <SPAN
CLASS="QUOTE"
>"failed"</SPAN
>, always examine the differences between
    expected and actual results; you may well find that the
    differences are not significant.  Nonetheless, we still strive to
    maintain accurate reference files across all supported platforms,
    so it can be expected that all tests pass.
   </P
><P
>    The actual outputs of the regression tests are in files in the
    <TT
CLASS="FILENAME"
>src/test/regress/results</TT
> directory. The test
    script uses <SPAN
CLASS="APPLICATION"
>diff</SPAN
> to compare each output
    file against the reference outputs stored in the
    <TT
CLASS="FILENAME"
>src/test/regress/expected</TT
> directory.  Any
    differences are saved for your inspection in
    <TT
CLASS="FILENAME"
>src/test/regress/regression.diffs</TT
>.  (Or you
    can run <SPAN
CLASS="APPLICATION"
>diff</SPAN
> yourself, if you prefer.)
   </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN23444"
>13.3.1. Error message differences</A
></H2
><P
>     Some of the regression tests involve intentional invalid input
     values.  Error messages can come from either the
     <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> code or from the host
     platform system routines. In the latter case, the messages may
     vary between platforms, but should reflect similar
     information. These differences in messages will result in a
     <SPAN
CLASS="QUOTE"
>"failed"</SPAN
> regression test that can be validated by
     inspection.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN23449"
>13.3.2. Locale differences</A
></H2
><P
>     If you run the tests against an already-installed server that was
     initialized with a collation order locale different than C then
     there may be differences due to sort order and follow-up
     failures.  The regression test suite is set up to handle this
     problem by providing alternative result files that together are
     known to handle a large number of locales.  For example, for the
     <SPAN
CLASS="QUOTE"
>"char"</SPAN
> test, the expected file
     <TT
CLASS="FILENAME"
>char.out</TT
> handles the <TT
CLASS="LITERAL"
>C</TT
> and <TT
CLASS="LITERAL"
>POSIX</TT
> locales,
     and the file <TT
CLASS="FILENAME"
>char_1.out</TT
> handles many other
     locales.  The regression test driver will automatically pick the
     best file to match against when checking for success and for
     computing failure differences.  (This means that the regression
     tests cannot detect whether the results are appropriate for the
     configured locale.  The tests will simply pick the one result
     file that works best.)
    </P
><P
>     If for some reason the existing expected files do not cover some
     locale, you can add a new file.  The naming scheme is
     <TT
CLASS="LITERAL"
><TT
CLASS="REPLACEABLE"
><I
>testname</I
></TT
>_<TT
CLASS="REPLACEABLE"
><I
>digit</I
></TT
>.out</TT
>.
     The actual digit is not significant.  Remember that the
     regression test driver will consider all such files to be equally
     valid test results.  If the test results are platform-dependent,
     the technique described in <A
HREF="regress-platform.html"
>Section 13.4</A
>
     should be used instead.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN23462"
>13.3.3. Date and time differences</A
></H2
><P
>     Some of the queries in the <TT
CLASS="FILENAME"
>horology</TT
> test will
     fail if you run the test on the day of a daylight-saving time
     changeover, or the day before or after one.  These queries assume
     that the intervals between midnight yesterday, midnight today and
     midnight tomorrow are exactly twenty-four hours -- which is wrong
     if daylight-saving time went into or out of effect meanwhile.
    </P
><P
>     Most of the date and time results are dependent on the time zone
     environment.  The reference files are generated for time zone
     <TT
CLASS="LITERAL"
>PST8PDT</TT
> (Berkeley, California) and there will be apparent
     failures if the tests are not run with that time zone setting.
     The regression test driver sets environment variable
     <TT
CLASS="ENVAR"
>PGTZ</TT
> to <TT
CLASS="LITERAL"
>PST8PDT</TT
>, which normally
     ensures proper results.  However, your system must provide library
     support for the <TT
CLASS="LITERAL"
>PST8PDT</TT
> time zone, or the time zone-dependent
     tests will fail. To verify that your machine does have this
     support, type the following:
</P><PRE
CLASS="SCREEN"
><TT
CLASS="PROMPT"
>$ </TT
><TT
CLASS="USERINPUT"
><B
>env TZ=PST8PDT date</B
></TT
></PRE
><P>
     The command above should have returned the current system time in
     the <TT
CLASS="LITERAL"
>PST8PDT</TT
> time zone. If the <TT
CLASS="LITERAL"
>PST8PDT</TT
> database is not available,
     then your system may have returned the time in GMT. If the
     <TT
CLASS="LITERAL"
>PST8PDT</TT
> time zone is not available, you can set the time zone
     rules explicitly:
</P><PRE
CLASS="PROGRAMLISTING"
>PGTZ='PST8PDT7,M04.01.0,M10.05.03'; export PGTZ</PRE
><P>
    </P
><P
>     There appear to be some systems that do not accept the
     recommended syntax for explicitly setting the local time zone
     rules; you may need to use a different <TT
CLASS="ENVAR"
>PGTZ</TT
>
     setting on such machines.
    </P
><P
>     Some systems using older time zone libraries fail to apply
     daylight-saving corrections to dates before 1970, causing
     pre-1970 <SPAN
CLASS="ACRONYM"
>PDT</SPAN
> times to be displayed in <SPAN
CLASS="ACRONYM"
>PST</SPAN
> instead.  This will
     result in localized differences in the test results.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN23483"
>13.3.4. Floating-point differences</A
></H2
><P
>     Some of the tests involve computing 64-bit (<TT
CLASS="TYPE"
>double
     precision</TT
>) numbers from table columns. Differences in
     results involving mathematical functions of <TT
CLASS="TYPE"
>double
     precision</TT
> columns have been observed.  The float8 and
     geometry tests are particularly prone to small differences across
     platforms, or even with different compiler optimization options.
     Human eyeball comparison is needed to determine the real
     significance of these differences which are usually 10 places to
     the right of the decimal point.
    </P
><P
>     Some systems signal errors from <TT
CLASS="FUNCTION"
>pow()</TT
> and
     <TT
CLASS="FUNCTION"
>exp()</TT
> differently from the mechanism
     expected by the current <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>
     code.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN23492"
>13.3.5. Polygon differences</A
></H2
><P
>     Several of the tests involve operations on geographic data about
     the Oakland/Berkeley, California street map. The map data is expressed as
     polygons whose vertices are represented as pairs of <TT
CLASS="TYPE"
>double
     precision</TT
> numbers (decimal latitude and
     longitude). Initially, some tables are created and loaded with
     geographic data, then some views are created that join two
     tables using the polygon intersection operator
     (<TT
CLASS="LITERAL"
>##</TT
>), then a select is done on the view.
    </P
><P
>     When comparing the results from different platforms, differences
     occur in the 2nd or 3rd place to the right of the decimal
     point. The SQL statements where these problems occur are the
     following:
</P><PRE
CLASS="PROGRAMLISTING"
>SELECT * from street;
SELECT * from iexit;</PRE
><P>
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN23499"
>13.3.6. Row ordering differences</A
></H2
><P
>You might see differences in which the same rows are output in a
different order than what appears in the expected file.  In most cases
this is not, strictly speaking, a bug.  Most of the regression test
scripts are not so pedantic as to use an ORDER BY for every single
SELECT, and so their result row orderings are not well-defined
according to the letter of the SQL specification.  In practice, since we are
looking at the same queries being executed on the same data by the same
software, we usually get the same result ordering on all platforms, and
so the lack of ORDER BY isn't a problem.  Some queries do exhibit
cross-platform ordering differences, however.  (Ordering differences
can also be triggered by non-C locale settings.)
    </P
><P
>Therefore, if you see an ordering difference, it's not something to
worry about, unless the query does have an ORDER BY that your result
is violating.  But please report it anyway, so that we can add an
ORDER BY to that particular query and thereby eliminate the bogus
<SPAN
CLASS="QUOTE"
>"failure"</SPAN
> in future releases.
    </P
><P
>You might wonder why we don't order all the regress test queries explicitly to
get rid of this issue once and for all.  The reason is that that would
make the regression tests less useful, not more, since they'd tend
to exercise query plan types that produce ordered results to the
exclusion of those that don't.
    </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN23505"
>13.3.7. The <SPAN
CLASS="QUOTE"
>"random"</SPAN
> test</A
></H2
><P
>     There is at least one case in the <SPAN
CLASS="QUOTE"
>"random"</SPAN
> test
     script that is intended to produce random results. This causes
     random to fail the regression test once in a while (perhaps once
     in every five to ten trials).  Typing
</P><PRE
CLASS="PROGRAMLISTING"
>diff results/random.out expected/random.out</PRE
><P>
     should produce only one or a few lines of differences.  You need
     not worry unless the random test always fails in repeated
     attempts.  (On the other hand, if the random test is
     <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>never</I
></SPAN
> reported to fail even in many trials
     of the regression tests, you probably <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>should</I
></SPAN
>
     worry.)
    </P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="regress-run.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="regress-platform.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Running the Tests</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="regress.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Platform-specific comparison files</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>