📄 regress.sgml
字号:
</para> </sect2> <sect2> <title>Date and time differences</title> <para> Most of the date and time results are dependent on the time zone environment. The reference files are generated for time zone <literal>PST8PDT</literal> (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 <envar>PGTZ</envar> to <literal>PST8PDT</literal>, which normally ensures proper results. </para> </sect2> <sect2> <title>Floating-point differences</title> <para> Some of the tests involve computing 64-bit floating-point numbers (<type>double precision</type>) from table columns. Differences in results involving mathematical functions of <type>double precision</type> columns have been observed. The <literal>float8</> and <literal>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. </para> <para> Some systems display minus zero as <literal>-0</>, while others just show <literal>0</>. </para> <para> Some systems signal errors from <function>pow()</function> and <function>exp()</function> differently from the mechanism expected by the current <productname>PostgreSQL</productname> code. </para> </sect2> <sect2> <title>Row ordering differences</title> <para>You might see differences in which the same rows are output in adifferent order than what appears in the expected file. In most casesthis is not, strictly speaking, a bug. Most of the regression testscripts are not so pedantic as to use an <literal>ORDER BY</> for every single<literal>SELECT</>, and so their result row orderings are not well-definedaccording to the letter of the SQL specification. In practice, since we arelooking at the same queries being executed on the same data by the samesoftware, we usually get the same result ordering on all platforms, andso the lack of <literal>ORDER BY</> isn't a problem. Some queries do exhibitcross-platform ordering differences, however. When testing against analready-installed server, ordering differences can also be caused bynon-C locale settings or non-default parameter settings, such as custom valuesof <varname>work_mem</> or the planner cost parameters. </para> <para>Therefore, if you see an ordering difference, it's not something toworry about, unless the query does have an <literal>ORDER BY</> that yourresult is violating. But please report it anyway, so that we can add an<literal>ORDER BY</> to that particular query and thereby eliminate the bogus<quote>failure</quote> in future releases. </para> <para>You might wonder why we don't order all the regression test queries explicitlyto get rid of this issue once and for all. The reason is that that wouldmake the regression tests less useful, not more, since they'd tendto exercise query plan types that produce ordered results to theexclusion of those that don't. </para> </sect2> <sect2> <title>Insufficient stack depth</title> <para> If the <literal>errors</literal> test results in a server crash at the <literal>select infinite_recurse()</> command, it means that the platform's limit on process stack size is smaller than the <xref linkend="guc-max-stack-depth"> parameter indicates. This can be fixed by running the postmaster under a higher stack size limit (4MB is recommended with the default value of <varname>max_stack_depth</>). If you are unable to do that, an alternative is to reduce the value of <varname>max_stack_depth</>. </para> </sect2> <sect2> <title>The <quote>random</quote> test</title> <para> The <literal>random</literal> test script is intended to produce random results. In rare cases, this causes the random regression test to fail. Typing<programlisting>diff results/random.out expected/random.out</programlisting> should produce only one or a few lines of differences. You need not worry unless the random test fails repeatedly. </para> </sect2> </sect1><!-- We might want to move the following section into the developer's guide. --> <sect1 id="regress-variant"> <title>Variant Comparison Files</title> <para> Since some of the tests inherently produce environment-dependent results, we have provided ways to specify alternative <quote>expected</> result files. Each regression test can have several comparison files showing possible results on different platforms. There are two independent mechanisms for determining which comparison file is used for each test. </para> <para> The first mechanism allows comparison files to be selected for specific platforms. There is a mapping file, <filename>src/test/regress/resultmap</filename>, that defines which comparison file to use for each platform. To eliminate bogus test <quote>failures</quote> for a particular platform, you first choose or make a variant result file, and then add a line to the <filename>resultmap</filename> file. </para> <para> Each line in the mapping file is of the form<synopsis>testname/platformpattern=comparisonfilename</synopsis> The test name is just the name of the particular regression test module. The platform pattern is a pattern in the style of the Unix tool <command>expr</> (that is, a regular expression with an implicit <literal>^</literal> anchor at the start). It is matched against the platform name as printed by <command>config.guess</command> followed by <literal>:gcc</literal> or <literal>:cc</literal>, depending on whether you use the GNU compiler or the system's native compiler (on systems where there is a difference). The comparison file name is the base name of the substitute result comparison file. </para> <para> For example: some systems interpret very small floating-point values as zero, rather than reporting an underflow error. This causes a few differences in the <filename>float8</> regression test. Therefore, we provide a variant comparison file, <filename>float8-small-is-zero.out</filename>, which includes the results to be expected on these systems. To silence the bogus <quote>failure</quote> message on <systemitem>OpenBSD</systemitem> platforms, <filename>resultmap</filename> includes<programlisting>float8/i.86-.*-openbsd=float8-small-is-zero</programlisting> which will trigger on any machine for which the output of <command>config.guess</command> matches <literal>i.86-.*-openbsd</literal>. Other lines in <filename>resultmap</> select the variant comparison file for other platforms where it's appropriate. </para> <para> The second selection mechanism for variant comparison files is much more automatic: it simply uses the <quote>best match</> among several supplied comparison files. The regression test driver script considers both the standard comparison file for a test, <literal><replaceable>testname</>.out</>, and variant files named <literal><replaceable>testname</>_<replaceable>digit</>.out</> (where the <replaceable>digit</> is any single digit <literal>0</>-<literal>9</>). If any such file is an exact match, the test is considered to pass; otherwise, the one that generates the shortest diff is used to create the failure report. (If <filename>resultmap</filename> includes an entry for the particular test, then the base <replaceable>testname</> is the substitute name given in <filename>resultmap</filename>.) </para> <para> For example, for the <literal>char</literal> test, the comparison file <filename>char.out</filename> contains results that are expected in the <literal>C</> and <literal>POSIX</> locales, while the file <filename>char_1.out</filename> contains results sorted as they appear in many other locales. </para> <para> The best-match mechanism was devised to cope with locale-dependent results, but it can be used in any situation where the test results cannot be predicted easily from the platform name alone. A limitation of this mechanism is that the test driver cannot tell which variant is actually <quote>correct</> for the current environment; it will just pick the variant that seems to work best. Therefore it is safest to use this mechanism only for variant results that you are willing to consider equally valid in all contexts. </para> </sect1> </chapter><!-- Keep this comment at the end of the fileLocal variables:mode:sgmlsgml-omittag:nilsgml-shorttag:tsgml-minimize-attributes:nilsgml-always-quote-attributes:tsgml-indent-step:1sgml-indent-data:tsgml-parent-document:nilsgml-default-dtd-file:"./reference.ced"sgml-exposed-tags:nilsgml-local-catalogs:("/usr/lib/sgml/catalog")sgml-local-ecat-files:nilEnd:-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -