You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2025/02/25 05:09:29 UTC

(couchdb) branch fix-flake-in-cfile-test created (now 9ff35bbff)

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a change to branch fix-flake-in-cfile-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at 9ff35bbff Fix flaky cfile closing test

This branch includes the following new commits:

     new 9ff35bbff Fix flaky cfile closing test

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(couchdb) 01/01: Fix flaky cfile closing test

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch fix-flake-in-cfile-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9ff35bbff0227e6cfd97622c95db21743514f9ce
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Tue Feb 25 00:08:18 2025 -0500

    Fix flaky cfile closing test
    
    In the test must wait for the file to close, since closing is asynchronous with
    respect to the process exit.
---
 src/couch/test/eunit/couch_cfile_tests.erl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/couch/test/eunit/couch_cfile_tests.erl b/src/couch/test/eunit/couch_cfile_tests.erl
index 87c15310c..a82ef1c28 100644
--- a/src/couch/test/eunit/couch_cfile_tests.erl
+++ b/src/couch/test/eunit/couch_cfile_tests.erl
@@ -391,6 +391,8 @@ t_monitor_is_closing_file_handles(Path) ->
     {ok, CFd} = proc_run(Proc, couch_cfile, dup, [Fd]),
     ?assertEqual(eof, file:pread(CFd, 0, 1)),
     kill_proc(Proc),
+    % Make sure to wait until it's closed
+    test_util:wait_value(fun() -> file:pread(CFd, 0, 1) end, {error, einval}),
     ?assertEqual({error, einval}, file:pread(CFd, 0, 1)).
 
 t_concurrent_reads_512b(Path) ->