summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2014-02-09 13:42:14 -0800
committerRuss Allbery <eagle@eyrie.org>2014-02-09 13:42:14 -0800
commit782a8f576881db6766e2c34a152eb3c477ff521f (patch)
tree8156e85697f7e4cb65e14a2695c880b565c5f18b
parent37c65db1a5adb785ed02efdc7120df99052b6df9 (diff)
Make the tools/backend test less sensitive to timing
* Fix the tools/backend test suite to be less sensitive to timing when queuing changes. (Closes: #738364) We were only allowing one second of tolerance, which is too fast for some slower architectures, and the code was improperly written so that the skip didn't trigger.
-rw-r--r--debian/changelog7
-rwxr-xr-xtests/tools/backend-t15
2 files changed, 16 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index f562d4a..bd46f11 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+krb5-sync (3.0-2) unstable; urgency=medium
+
+ * Fix the tools/backend test suite to be less sensitive to timing when
+ queuing changes. (Closes: #738364)
+
+ -- Russ Allbery <rra@debian.org> Sun, 09 Feb 2014 13:41:36 -0800
+
krb5-sync (3.0-1) unstable; urgency=low
* New upstream release.
diff --git a/tests/tools/backend-t b/tests/tools/backend-t
index 30f265c..146e2f8 100755
--- a/tests/tools/backend-t
+++ b/tests/tools/backend-t
@@ -87,9 +87,9 @@ sub run_backend_checked {
# Given a user, an action, and (for a password change) the new password,
# locate that queued action and check that the correct information was stored
-# for it. Expects the action to have been queued in the past second. Reports
-# results with Test::More functions. Always uses a directory named 'queue'
-# under test_tmpdir() as the queue directory.
+# for it. Expects the action to have been queued in the five seconds.
+# Reports results with Test::More functions. Always uses a directory named
+# 'queue' under test_tmpdir() as the queue directory.
#
# $user - User for which the action should be queued
# $action - The queued action, chosen from enable, disable, or password
@@ -109,9 +109,12 @@ sub check_queued_action {
# with the same timestamp with a non-zero sequence number.
my $now = time;
my $path;
- for my $time ($now - 1 .. $now) {
- $path = $base . strftime('%Y%m%dT%H%M%SZ-00', gmtime($time));
- last if -f $path;
+ for my $time ($now - 5 .. $now) {
+ my $candidate = $base . strftime('%Y%m%dT%H%M%SZ-00', gmtime($time));
+ if (-f $candidate) {
+ $path = $candidate;
+ last;
+ }
}
ok(defined($path), 'Queued change found');