You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by si...@apache.org on 2024/05/04 06:21:52 UTC
svn commit: r1917490 - /spamassassin/trunk/t/spamd_client.t
Author: sidney
Date: Sat May 4 06:21:52 2024
New Revision: 1917490
URL: http://svn.apache.org/viewvc?rev=1917490&view=rev
Log:
Bug 8253 - make test more robust against low memory on test machine
Modified:
spamassassin/trunk/t/spamd_client.t
Modified: spamassassin/trunk/t/spamd_client.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/spamd_client.t?rev=1917490&r1=1917489&r2=1917490&view=diff
==============================================================================
--- spamassassin/trunk/t/spamd_client.t (original)
+++ spamassassin/trunk/t/spamd_client.t Sat May 4 06:21:52 2024
@@ -9,6 +9,8 @@ use Test::More;
plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+diag "\nIf test fails 'connection reset by peer', may be low memory on test machine";
+
# TODO: These should be skips down in the code, not changing the test count.
my $num_tests = 18;
@@ -36,7 +38,8 @@ ok($testmsg);
'XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X', 'gtube string',
);
-ok(start_spamd("-L"));
+# Bug 8253 - starting spamd after creating client object makes test failures
+# caused by low memory on test machine less likely.
my $client = create_clientobj({
port => $spamdport,
@@ -45,6 +48,8 @@ my $client = create_clientobj({
ok($client);
+ok(start_spamd("-L"));
+
ok($client->ping());
my $result = $client->check($testmsg);
@@ -98,7 +103,6 @@ if (!$RUNNING_ON_WINDOWS) {
%anti_patterns = ();
my $sockpath = mk_socket_tempdir()."/spamd.sock";
- ok(start_spamd("-L --socketpath=$sockpath"));
$client = create_clientobj({
socketpath => $sockpath,
@@ -106,6 +110,8 @@ if (!$RUNNING_ON_WINDOWS) {
ok($client);
+ ok(start_spamd("-L --socketpath=$sockpath"));
+
ok($client->ping());
$result = $client->check($testmsg);
@@ -137,8 +143,6 @@ if (HAS_SDBM_FILE) {
bayes_store_module Mail::SpamAssassin::BayesStore::SDBM
");
- ok(start_spamd("-L --allow-tell"));
-
my $client = create_clientobj({
port => $spamdport,
host => $spamdhost,
@@ -149,6 +153,8 @@ if (HAS_SDBM_FILE) {
my $spammsg = getmessage("data/spam/001");
ok($spammsg);
+ ok(start_spamd("-L --allow-tell"));
+
ok($client->learn($spammsg, 0));
ok(!$client->learn($spammsg, 0));