couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject couch-log commit: updated refs/heads/master to afe8375
Date Fri, 05 Aug 2016 14:37:39 GMT
Repository: couchdb-couch-log
Updated Branches:
  refs/heads/master 741d48c94 -> afe8375e0


Fix test failure on Windows

The file writer test has a couple checks that rely on Unix style file
handling for log rotation. Moving and deleting open files isn't possible
on Windows so these tests are disabled there.

COUCHDB-3092


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/commit/afe8375e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/tree/afe8375e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/diff/afe8375e

Branch: refs/heads/master
Commit: afe8375e08808f01984d03286dace759b37efc05
Parents: 741d48c
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Fri Aug 5 09:36:19 2016 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Fri Aug 5 09:37:33 2016 -0500

----------------------------------------------------------------------
 test/couch_log_writer_file_test.erl | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/blob/afe8375e/test/couch_log_writer_file_test.erl
----------------------------------------------------------------------
diff --git a/test/couch_log_writer_file_test.erl b/test/couch_log_writer_file_test.erl
index 6d3f3ec..ba04261 100644
--- a/test/couch_log_writer_file_test.erl
+++ b/test/couch_log_writer_file_test.erl
@@ -141,16 +141,24 @@ check_reopen() ->
     {ok, St2} = clear_clock(couch_log_writer_file:maybe_reopen(St1)),
     ?assertEqual(St1, St2),
 
-    % Delete file
-    file:delete("./couch.log"),
-    {ok, St3} = clear_clock(couch_log_writer_file:maybe_reopen(St2)),
-    ?assert(element(3, St3) /= element(3, St2)),
-
-    % Recreate file
-    file:delete("./couch.log"),
-    file:write_file("./couch.log", ""),
-    {ok, St4} = clear_clock(couch_log_writer_file:maybe_reopen(St3)),
-    ?assert(element(3, St4) /= element(3, St2)).
+    case os:type() of
+        {win32, _} ->
+            % Windows file handling doesn't work the same
+            % as Unix where you can move or delete an open
+            % file so these tests make no sense there.
+            yay_we_pass;
+        _ ->
+            % Delete file
+            file:delete("./couch.log"),
+            {ok, St3} = clear_clock(couch_log_writer_file:maybe_reopen(St2)),
+            ?assert(element(3, St3) /= element(3, St2)),
+
+            % Recreate file
+            file:delete("./couch.log"),
+            file:write_file("./couch.log", ""),
+            {ok, St4} = clear_clock(couch_log_writer_file:maybe_reopen(St3)),
+            ?assert(element(3, St4) /= element(3, St2))
+    end.
 
 
 clear_clock({ok, St}) ->


Mime
View raw message