{
my($date1,$date2,$date3,$expired) = ($1,$2,$3,$4);
$expired = '' if !defined $expired;
- my($increment) = date_seconds($date3) - date_seconds($date2);
+
+ # Round the time-difference up to nearest even value
+ my($increment) = ((date_seconds($date3) - date_seconds($date2) + 1) >> 1) << 1;
# We used to use globally unique replacement values, but timing
# differences make this impossible. Just show the increment on the
# In this test, the primary host (normal IP address) defers the recipient, and
# the secondary host (loopback address) defers the connection.
#
+#XXX the test is relying on one-second accuracy, which is too tight.
+# The measured time is only one-second precision, so certain to sometime
+# straddle a boundary, even ignoring scheduling and I/O-wait issues.
+# Consider a factor of (?) two, in the retry section of the conf/ file
+# and +1 /2 after the diff operation (runtest:463).
+#
need_ipv4
#
exim -DSERVER=server -bd -oX PORT_D
****
# defers from both
dump retry
-millisleep 2100
+millisleep 4200
# At this point, the primary host retry rule ehould have timed out
# and the secondary is ready for a retry
exim -q
****
dump retry
-millisleep 2100
+millisleep 4200
# This should be similar
exim -q
****
Test message 2.
****
dump retry
-millisleep 2000
+millisleep 4000
exim -q
****
killdaemon
+++++++++++++++++++++++++++
R:userx@test.ex:<CALLER@test.ex> -44 13121 H=ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4]: SMTP error from remote mail server after RCPT TO:<userx@test.ex>: 451 Recipient deferred
-first failed = time last try = time2 next try = time2 + 1
- T:thishost.test.ex:127.0.0.1:1225 0 65 H=thishost.test.ex [127.0.0.1]: SMTP error from remote mail server after initial connection: 451 host deferred
first failed = time last try = time2 next try = time2 + 2
+ T:thishost.test.ex:127.0.0.1:1225 0 65 H=thishost.test.ex [127.0.0.1]: SMTP error from remote mail server after initial connection: 451 host deferred
+first failed = time last try = time2 next try = time2 + 4
+++++++++++++++++++++++++++
R:userx@test.ex:<CALLER@test.ex> -44 13121 H=ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4]: SMTP error from remote mail server after RCPT TO:<userx@test.ex>: 451 Recipient deferred
-first failed = time last try = time2 next try = time2 + 5 *
+first failed = time last try = time2 next try = time2 + 10 *
T:thishost.test.ex:127.0.0.1:1225 0 65 H=thishost.test.ex [127.0.0.1]: SMTP error from remote mail server after initial connection: 451 host deferred
-first failed = time last try = time2 next try = time2 + 2
+first failed = time last try = time2 next try = time2 + 4
+++++++++++++++++++++++++++
R:userx@test.ex:<CALLER@test.ex> -44 13121 H=ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4]: SMTP error from remote mail server after RCPT TO:<userx@test.ex>: 451 Recipient deferred
-first failed = time last try = time2 next try = time2 + 5 *
+first failed = time last try = time2 next try = time2 + 10 *
T:thishost.test.ex:127.0.0.1:1225 0 65 H=thishost.test.ex [127.0.0.1]: SMTP error from remote mail server after initial connection: 451 host deferred
-first failed = time last try = time2 next try = time2 + 2
+first failed = time last try = time2 next try = time2 + 4
+++++++++++++++++++++++++++
R:userx@test.ex:<CALLER@test.ex> -44 13121 H=ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4]: SMTP error from remote mail server after RCPT TO:<userx@test.ex>: 451 Recipient deferred
-first failed = time last try = time2 next try = time2 + 5 *
+first failed = time last try = time2 next try = time2 + 10 *
R:usery@test.ex:<CALLER@test.ex> -44 13121 H=ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4]: SMTP error from remote mail server after RCPT TO:<usery@test.ex>: 451 Recipient deferred
-first failed = time last try = time2 next try = time2 + 1
- T:thishost.test.ex:127.0.0.1:1225 0 65 H=thishost.test.ex [127.0.0.1]: SMTP error from remote mail server after initial connection: 451 host deferred
first failed = time last try = time2 next try = time2 + 2
+ T:thishost.test.ex:127.0.0.1:1225 0 65 H=thishost.test.ex [127.0.0.1]: SMTP error from remote mail server after initial connection: 451 host deferred
+first failed = time last try = time2 next try = time2 + 4