From 3a3a9c1efab1c9fe4cd5ebb6c80da4005eb0806b Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Thu, 4 Mar 2010 01:09:22 +0000 Subject: Changed process tree shutdown to be synchronous, to eliminate spurious test failures caused by processes not shutdown fast enough or at the wrong time. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@918805 13f79535-47bb-0310-9956-ffa450edef68 --- test/etap/010-file-basics.t | 13 +++++++++++++ test/etap/040-util.t | 23 ----------------------- 2 files changed, 13 insertions(+), 23 deletions(-) (limited to 'test/etap') diff --git a/test/etap/010-file-basics.t b/test/etap/010-file-basics.t index 09b2f2b1..595d87e9 100755 --- a/test/etap/010-file-basics.t +++ b/test/etap/010-file-basics.t @@ -67,6 +67,19 @@ test() -> {ok, BinPos} = couch_file:append_binary(Fd, <<131,100,0,3,102,111,111>>), etap:is({ok, foo}, couch_file:pread_term(Fd, BinPos), "Reading a term from a written binary term representation succeeds."), + + BigBin = list_to_binary(lists:duplicate(100000, 0)), + {ok, BigBinPos} = couch_file:append_binary(Fd, BigBin), + etap:is({ok, BigBin}, couch_file:pread_binary(Fd, BigBinPos), + "Reading a large term from a written representation succeeds."), + + ok = couch_file:write_header(Fd, hello), + etap:is({ok, hello}, couch_file:read_header(Fd), + "Reading a header succeeds."), + + {ok, BigBinPos2} = couch_file:append_binary(Fd, BigBin), + etap:is({ok, BigBin}, couch_file:pread_binary(Fd, BigBinPos2), + "Reading a large term from a written representation succeeds 2."), % append_binary == append_iolist? % Possible bug in pread_iolist or iolist() -> append_binary diff --git a/test/etap/040-util.t b/test/etap/040-util.t index 4500d38a..9c8f3d5a 100755 --- a/test/etap/040-util.t +++ b/test/etap/040-util.t @@ -35,29 +35,6 @@ test() -> etap:is(foobarbaz, couch_util:to_existing_atom("foobarbaz"), "A list of atoms is one munged atom."), - % terminate_linked - Self = self(), - - spawn(fun() -> - SecondSelf = self(), - ChildPid = spawn_link(fun() -> - SecondSelf ! {child, started}, - receive shutdown -> ok end - end), - PidUp = receive - {child, started} -> ok - after 1000 -> - {error, timeout} - end, - etap:is(ok, PidUp, "Started a linked process."), - couch_util:terminate_linked(normal), - Self ! {pid, ChildPid} - end), - receive - {pid, Pid} -> - etap:ok(not is_process_alive(Pid), "Linked process was killed.") - end, - % implode etap:is([1, 38, 2, 38, 3], couch_util:implode([1,2,3],"&"), "use & as separator in list."), -- cgit v1.2.3