Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
eunit question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Amit Murthy  
View profile  
 More options Aug 16 2009, 6:02 am
From: Amit Murthy <amit.mur...@gmail.com>
Date: Sun, 16 Aug 2009 15:32:38 +0530
Local: Sun, Aug 16 2009 6:02 am
Subject: [erlang-questions] eunit question

Hi,

I am using eunit for some simple tests and within a test have a need to
sleep for a couple of seconds, i.e. the test function flows something like
this:

func_test() ->
 some erlang code...
 wait_for_2_seconds(),
 some more erlang code....

To implement the wait_for_2_seconds() I have tried
  receive after 2000 -> ok end,            and
   timer:sleep(2000),
   as well as writing a simple spin wait function that just does idle
recursive execution in place for 2 seconds.

All of the above basically result in my eunit test function just hanging
forever and the last line printed on screen is

met_fb:request_content_ban_test...*timed out*

where met_fb is the module under test and request_content_ban_test is the
test function.

The actual test function is

request_content_ban_test() ->
    ?debugFmt("~n~nTEST : request_content_ban", []),
    ok = request_content_ban(2, 1, 1, 2, 1),
    ok = request_content_ban(3, 1, 1, 3, 2),

    % spin loop for 2 seconds
    spin_loop(epoch_secs(), 2),

    ?debugFmt("~n~nTEST : get_content_to_review", []),
    Now = epoch_secs(),
    [2,3] = get_content_to_review(1, 1, Now - 120),

    ok = request_content_ban(4, 1, 1, 9, 3),
    [4] = get_content_to_review(1, 1, Now - 1).

Would appreciate any help in figuring out what is going on here.

Regards,
  Amit


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Carlsson  
View profile  
 More options Aug 17 2009, 2:11 pm
From: Richard Carlsson <richa...@it.uu.se>
Date: Mon, 17 Aug 2009 20:11:04 +0200
Local: Mon, Aug 17 2009 2:11 pm
Subject: Re: [erlang-questions] eunit question

Amit Murthy wrote:
> All of the above basically result in my eunit test function just hanging
> forever and the last line printed on screen is

> met_fb:request_content_ban_test...*timed out*

Older versions of eunit (before OTP R13B) used to have this
kind of problem. Which version are you using?

     /Richard

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Amit Murthy  
View profile  
 More options Aug 17 2009, 2:15 pm
From: Amit Murthy <amit.mur...@gmail.com>
Date: Mon, 17 Aug 2009 23:45:36 +0530
Local: Mon, Aug 17 2009 2:15 pm
Subject: Re: [erlang-questions] eunit question

R13A. I guess that explains it.

On Mon, Aug 17, 2009 at 11:41 PM, Richard Carlsson <richa...@it.uu.se>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Amit Murthy  
View profile  
 More options Aug 16 2009, 8:24 am
From: Amit Murthy <amit.mur...@gmail.com>
Date: Sun, 16 Aug 2009 17:54:47 +0530
Local: Sun, Aug 16 2009 8:24 am
Subject: [erlang-questions] Re: eunit question

My bad.

Seems like the default timeout for a single test is 5 seconds. I increased
it using the "timeout" test descriptor and things are OK now.

But I still don't understand why my erlang console should just hang after
the "met_fb:request_content_ban_test...*timed out*" message is printed.

  Amit


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Amit Murthy  
View profile  
 More options Aug 18 2009, 12:03 am
From: Amit Murthy <amit.mur...@gmail.com>
Date: Tue, 18 Aug 2009 09:33:45 +0530
Local: Tues, Aug 18 2009 12:03 am
Subject: Re: [erlang-questions] eunit question

Also the default timeout of around 5 seconds for a single test does not seem
to have been documented anywhere.

Once I increased it using the "timeout" control specification, my test cases
went through.

  Amit


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Carlsson  
View profile  
 More options Aug 18 2009, 4:06 am
From: Richard Carlsson <richa...@it.uu.se>
Date: Tue, 18 Aug 2009 10:06:10 +0200
Local: Tues, Aug 18 2009 4:06 am
Subject: Re: [erlang-questions] Re: eunit question

Amit Murthy wrote:
> My bad.

> Seems like the default timeout for a single test is 5 seconds. I increased
> it using the "timeout" test descriptor and things are OK now.

> But I still don't understand why my erlang console should just hang after
> the "met_fb:request_content_ban_test...*timed out*" message is printed.

It's the eunit frontend that hangs; it's still waiting for some message
from the test, and doesn't return to the shell. But as far as I know,
this only happens in versions before R13B.

    /Richard

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »