subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1179117 - /subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
Date Wed, 05 Oct 2011 09:23:13 GMT
Author: philip
Date: Wed Oct  5 09:23:13 2011
New Revision: 1179117

URL: http://svn.apache.org/viewvc?rev=1179117&view=rev
Log:
* subversion/tests/cmdline/svnadmin_tests.py
  (test_lslocks_and_rmlocks): Check for two different timestamps to avoid
   spurious test FAILs.

Modified:
    subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py?rev=1179117&r1=1179116&r2=1179117&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Wed Oct  5 09:23:13 2011
@@ -1405,7 +1405,7 @@ def test_lslocks_and_rmlocks(sbox):
                                      [], "lock", "-m", "Locking files",
                                      iota_url, lambda_url)
 
-  expected_output = svntest.verify.UnorderedRegexOutput([
+  expected_output_list = [
       "Path: /A/B/lambda",
       "UUID Token: opaquelocktoken",
       "Owner: jrandom",
@@ -1416,7 +1416,7 @@ def test_lslocks_and_rmlocks(sbox):
       "Path: /iota",
       "UUID Token: opaquelocktoken.*",      
       "\n", # empty line    
-      ])
+      ]
 
   # List all locks
   exit_code, output, errput = svntest.main.run_svnadmin("lslocks",
@@ -1424,10 +1424,25 @@ def test_lslocks_and_rmlocks(sbox):
   
   if errput:
     raise SVNUnexpectedStderr(errput)
-    
-  svntest.verify.compare_and_display_lines('lslocks output mismatch', 'output',
-                                           expected_output, output)
   svntest.verify.verify_exit_code(None, exit_code, 0)
+    
+  try:
+    expected_output = svntest.verify.UnorderedRegexOutput(expected_output_list)
+    svntest.verify.compare_and_display_lines('lslocks output mismatch',
+                                             'output',
+                                             expected_output, output)
+  except:
+    # Usually both locks have the same timestamp but if the clock
+    # ticks between creating the two locks then the timestamps will
+    # differ.  When the output has two identical "Created" lines
+    # UnorderedRegexOutput must have one matching regex, when the
+    # output has two different "Created" lines UnorderedRegexOutput
+    # must have two regex.
+    expected_output_list.append("Created:.*")
+    expected_output = svntest.verify.UnorderedRegexOutput(expected_output_list)
+    svntest.verify.compare_and_display_lines('lslocks output mismatch',
+                                             'output',
+                                             expected_output, output)
 
   # List lock in path /A
   exit_code, output, errput = svntest.main.run_svnadmin("lslocks",



Mime
View raw message