You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@spamassassin.apache.org on 2023/01/04 23:13:22 UTC

[Bug 8100] New: t/bayessql.t test failures with postgres

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8100

            Bug ID: 8100
           Summary: t/bayessql.t test failures with postgres
           Product: Spamassassin
           Version: 4.0.0
          Hardware: PC
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Regression Tests
          Assignee: dev@spamassassin.apache.org
          Reporter: sidney@sidney.com
  Target Milestone: Undefined

After setting up a test machine with postgres for bug 8098 I configured
t/conf.dist to also run bayes sql tests using that server and I get the
following errors.

Here are the commands in the script that initializes the sql database on an
Ubuntu 22.04 VM with postgres installed

    sudo systemctl start postgresql.service
    pg_isready
    sudo -u postgres psql --command="CREATE USER spamassassin PASSWORD
'spamassassin'" --command="\du"
    sudo -u postgres createdb --owner=spamassassin spamassassin
    PGPASSWORD=spamassassin psql --username=spamassassin --host=localhost -d
spamassassin -f sql/awl_pg.sql
    PGPASSWORD=spamassassin psql --username=spamassassin --host=localhost -d
spamassassin -f sql/bayes_pg.sql

Here are the entries in t/config.dist to enable the bayessql.t tests to run
using the postgres database

    run_bayes_sql_tests=y

    # Bayes Store Module (bayes_store_module)
    bayes_store_module=Mail::SpamAssassin::BayesStore::MySQL
    # Bayes SQL DSN (bayes_sql_dsn)
    bayes_sql_dsn=dbi:Pg:dbname=spamassassin;host=localhost
    # Bayes SQL DB username (bayes_sql_username)
    bayes_sql_username=spamassassin
    # Bayes SQL DB password (bayes_sql_password)
    bayes_sql_password=spamassassin

Here is the results from running the test. It doesn't leave anything in t/log
like other failing tests do. The test command is
    make test TEST_FILES="t/bayessql.t"

    t/bayessql.t .. # Note: If there is a failure it may be due to an incorrect
SQL configuration.
    t/bayessql.t .. 60/118 
    #   Failed test at t/bayessql.t line 153.

    #   Failed test at t/bayessql.t line 157.
    t/bayessql.t .. 69/118 
    #   Failed test at t/bayessql.t line 251.

    #   Failed test at t/bayessql.t line 255.
    t/bayessql.t .. 84/118 
    #   Failed test at t/bayessql.t line 268.

    #   Failed test at t/bayessql.t line 290.

    #   Failed test at t/bayessql.t line 303.

    #   Failed test at t/bayessql.t line 307.
    t/bayessql.t .. 94/118 Use of uninitialized value $vars[4] in subtraction
(-) at ../blib/lib/Mail/SpamAssassin/BayesStore.pm line 465.
    Use of uninitialized value $ntoks in concatenation (.) or string at
../blib/lib/Mail/SpamAssassin/BayesStore.pm line 477.
    Use of uninitialized value $vars[5] in concatenation (.) or string at
../blib/lib/Mail/SpamAssassin/BayesStore.pm line 477.
    Use of uninitialized value $vars[10] in concatenation (.) or string at
../blib/lib/Mail/SpamAssassin/BayesStore.pm line 477.
    Use of uninitialized value $vars[4] in concatenation (.) or string at
../blib/lib/Mail/SpamAssassin/BayesStore.pm line 477.
    Use of uninitialized value $ntoks in numeric le (<=) at
../blib/lib/Mail/SpamAssassin/BayesStore.pm line 480.
    t/bayessql.t .. 113/118 
    #   Failed test at t/bayessql.t line 412.

    #   Failed test at t/bayessql.t line 441.
    # Looks like you failed 10 tests of 118.
    t/bayessql.t .. Dubious, test returned 10 (wstat 2560, 0xa00)
    Failed 10/118 subtests 

    Test Summary Report
    -------------------
    t/bayessql.t (Wstat: 2560 (exited 10) Tests: 118 Failed: 10)
      Failed tests:  63, 65, 81, 83, 85, 90, 92-93, 114-115
      Non-zero exit status: 10

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8100] t/bayessql.t test failures with postgres

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8100

Sidney Markowitz <si...@sidney.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
                 CC|                            |sidney@sidney.com
             Status|NEW                         |RESOLVED

--- Comment #2 from Sidney Markowitz <si...@sidney.com> ---
(In reply to Benny Pedersen from comment #1)
> bayes_store_module=Mail::SpamAssassin::BayesStore::MySQL
> 
> this is mysql not postgres

Whoops! [insert embarrassed emoji here]

I'm glad I was thorough enough to copy and paste all the test settings into the
bug report. Thanks for catching that Benny.

The test passes fine when I change that from MySQL to PgSQL

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8100] t/bayessql.t test failures with postgres

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8100

Benny Pedersen <me...@junc.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |me@junc.eu

--- Comment #1 from Benny Pedersen <me...@junc.eu> ---
bayes_store_module=Mail::SpamAssassin::BayesStore::MySQL

this is mysql not postgres

-- 
You are receiving this mail because:
You are the assignee for the bug.