seems bug in eunit timeouts

Alex Kutsko <>
Wed Nov 18 11:59:09 CET 2009


eunit 2.1.3, OTP R13B02-1

Problem description: In case when one of the functions within a group of
tests throws an error, timeout resets to default one ( in my case 5 secs):
-module(test).
-include_lib("eunit/include/eunit.hrl").
slow_test_() ->
     {timeout, 300,
      [?_assertEqual(ok, test1()),
       ?_assertEqual(ok, test2())
       ]}.

test1() ->
    throw(error),
    ok.

test2() ->
    timer:sleep(6000),
    ok.

Execution:
eunit:test(test).
test:11: slow_test_...*failed*
::throw:error
  in function test:test1/0
  in call from test:'-slow_test_/0-fun-0-'/1
  output:<<"Timeout set in eunit= 5000 %% mine output in eunit_proc.erl
module set_timeout/2 method
">>

test:12: slow_test_...*timed out*


In this test, despite the timeout of the group set to 300 sec, after test1
throwing error, timeout sets to 5 sec. I think this is wrong. (if you remove
throw(error) from test1 function, you'll get successfully passed test2).

-- 
Best regards,
Alex Kutsko,


More information about the erlang-bugs mailing list