systemio systemio | 1 Feb 15:13
Picon

eunit timeout doesn't work properly

My function works about 7 seconds.
i test my function via {timeout,100,[{setup,S,C,F}]} and always get timeout after 5 seconds.
BUT if i test my function via {timeout,1,[{setup,S,C,F}]} i will get timeout after a second.
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

Roberto Aloi | 1 Feb 17:28
Favicon

Re: eunit timeout doesn't work properly

Hi,

5 seconds sounds like the typical default timeout for a gen_server.
Are you sure it's the eunit test itself which is timing out and not some other part of the system?

Could you please share some code?

Roberto Aloi
---
Erlang Solutions Ltd.
www.erlang-solutions.com

----- Original Message -----
> My function works about 7 seconds.
> i test my function via {timeout,100,[{setup,S,C,F}]} and always get
> timeout after 5 seconds.
> BUT if i test my function via {timeout,1,[{setup,S,C,F}]} i will get
> timeout after a second.
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs <at> erlang.org
> http://erlang.org/mailman/listinfo/erlang-bugs
> 
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

pan | 1 Feb 17:50
Favicon
Gravatar

Re: ssh daemon and encoding.

Hi Erik!

You are absolutely right about that 'user' and 'group' are used in 
different situations and that the names are utterly confusing. 'group' is 
used in *interactive shell sessions* and will determine unicode mode from 
LOCALE/terminal settings, while 'user' is for non interactive stdin/stdout 
(pipes, redirected files, dumb terminals etc), in which case you *have to* 
set unicode mode manually. Your first example will run the io:setopts 
before the group server is fully initialized, why you will get an 
unexpected behaviour. If you were to do the same when the interactive 
shell was actually started, the behaviour would be as expected.

If opting to set unicode mode for an interactive session, set the LOCALE 
correctly. If running a non interactive session, use -oldshell or 
-noshell and do as in your second example.

The problem reported however, was easilly found. It is due to that ssh_cli 
does not handle setting of unicode mode, which is a problem in the ssh 
application (that does not fully handle unicode). The internal protocol 
between io-server and ssh_cli will call 
ssh_cli:handle_msg({Pid,set_unicode_state,true},State), which is ignored 
by the ssh_cli code. Supporting unicode here could be done by simply 
expecting the terminal in the other end to support UTF8 characters if 
unicode mode was enabled, which would be the same behaviour as in the 
'user' io-server. That however requires a fair amount of coding and the 
ssh application is far away from my jurisdiction :)

Cheers,
/Patrik, OTP

(Continue reading)

systemio systemio | 1 Feb 17:58
Picon

Re: eunit timeout doesn't work properly

here is the code in the module
smoke_test_() ->
S = fun() -> ok end,
C = fun(_) -> ok end,
F = fun(_) -> fun() -> timer:sleep(6000) end end,
{timeout,100,[{setup,S,C,F}]}.

and i start it via erlang shell: eunit:test([{inparallel,smoke}],[{report,{eunit_surefire,[{dir,"./Reports"}]}}]).

it breaks after 5 seconds, in spite of i gave it a 100 seconds timeout.

01 февраля 2012, 20:29 от Roberto Aloi <roberto.aloi <at> erlang-solutions.com>:
> Hi,
> 
> 5 seconds sounds like the typical default timeout for a gen_server.
> Are you sure it's the eunit test itself which is timing out and not some other part of the system?
> 
> Could you please share some code?
> 
> Roberto Aloi
> ---
> Erlang Solutions Ltd.
> www.erlang-solutions.com
> 
> ----- Original Message -----
> > My function works about 7 seconds.
> > i test my function via {timeout,100,[{setup,S,C,F}]} and always get
> > timeout after 5 seconds.
> > BUT if i test my function via {timeout,1,[{setup,S,C,F}]} i will get
> > timeout after a second.
(Continue reading)

Tuncer Ayaz | 1 Feb 18:59
Picon

escript: interesting stack trace

Running the following (simplified) erroneous piece of code as part
of the rebar binary, a tiny escript, or erl shell gives mostly easy
to follow stack traces.

lists:append([{a,[b]},{c,[d]}]).

I was only surprised to see win32reg:expand/1 on Linux and Darwin.
Is this expected behaviour?

The different stack traces are:

as part of the rebar binary
$ rebar compile
{'EXIT',{badarg,[{erlang,memory,0,[]},
                 {escript,run,2,[]},
                 {escript,start,1,[]},
                 {erlang,memory,0,[]}]}}

on the erl shell
$ erl
1> lists:append([{a,[b]},{c,[d]}]).
** exception error: bad argument
     in function  erl_eval:do_apply/6
     in call from shell:exprs/7
     in call from shell:eval_exprs/7
     in call from shell:eval_loop/3
     in call from erlang:memory/0

trivial escript
$ cat append1.escript
(Continue reading)

Fyodor Ustinov | 1 Feb 19:13
Picon
Gravatar

Re: ssh daemon and encoding.

On 01.02.2012 18:50, pan <at> erlang.org wrote:
Hi Erik!
Can I expect that it will be seen as a bug and corrected in the next version?

You are absolutely right about that 'user' and 'group' are used in different situations and that the names are utterly confusing. 'group' is used in *interactive shell sessions* and will determine unicode mode from LOCALE/terminal settings, while 'user' is for non interactive stdin/stdout (pipes, redirected files, dumb terminals etc), in which case you *have to* set unicode mode manually. Your first example will run the io:setopts before the group server is fully initialized, why you will get an unexpected behaviour. If you were to do the same when the interactive shell was actually started, the behaviour would be as expected.

If opting to set unicode mode for an interactive session, set the LOCALE correctly. If running a non interactive session, use -oldshell or -noshell and do as in your second example.

The problem reported however, was easilly found. It is due to that ssh_cli does not handle setting of unicode mode, which is a problem in the ssh application (that does not fully handle unicode). The internal protocol between io-server and ssh_cli will call ssh_cli:handle_msg({Pid,set_unicode_state,true},State), which is ignored by the ssh_cli code. Supporting unicode here could be done by simply expecting the terminal in the other end to support UTF8 characters if unicode mode was enabled, which would be the same behaviour as in the 'user' io-server. That however requires a fair amount of coding and the ssh application is far away from my jurisdiction :)

Cheers,
/Patrik, OTP


On Tue, 31 Jan 2012, Erik Søe Sørensen wrote:

This is probably not related to SSH.
As was found out earlier on this list, the encoding behaviour (confusingly) depends on how Erlang was started:

  $ erl -eval 'ok = io:setopts([{encoding, unicode}]),
  io:format("~p~n", [io:getopts()]), init:stop().'
  Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:8:8] [rq:8]
  [async-threads:0] [hipe] [kernel-poll:false]

  Eshell V5.8.4  (abort with ^G)
  1> [{expand_fun,#Fun<group.0.120017273>},
    {echo,true},
    {binary,false},
    {encoding,latin1}]
  $ erl -eval 'ok = io:setopts([{encoding, unicode}]),
  io:format("~p~n", [io:getopts()]), init:stop().' -noinput
  [{binary,false},{encoding,unicode}]
  $ erl -eval 'ok = io:setopts([{encoding, unicode}]),
  io:format("~p~n", [io:getopts()]), init:stop().' -noshell
  [{binary,false},{encoding,unicode}]

This has do do with the fact that in one case, the 'group' module handles I/O, while in the other case it's the 'user' module.
(I don't know enough to say anything intelligent about why this is, why two modules with overlapping functionality but different encoding behaviour exist, or what their purposes are besides handling I/O.)

On 31-01-2012 14:00, Fyodor Ustinov wrote:
Hi!

Unable to set encoding to unicode in ssh daemon session.

ok = io:setopts([{expand_fun, fun expand_prompt/1}, {encoding, unicode}]),
io:format("~p~n", [io:getopts()])

say:

[{expand_fun,#Fun<group.0.33302583>},
   {echo,true},
   {binary,false},
   {encoding,latin1}]

WBR,
      Fyodor.

_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs


-- 
Mobile: + 45 26 36 17 55 | Skype: eriksoesorensen | Twitter: <at> eriksoe
Trifork A/S  |  Margrethepladsen 4  |  DK-8000 Aarhus C | www.trifork.com <http://www.trifork.com/>



_______________________________________________ erlang-bugs mailing list erlang-bugs <at> erlang.org http://erlang.org/mailman/listinfo/erlang-bugs

_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Richard Carlsson | 1 Feb 19:27
Picon
Gravatar

Re: eunit timeout doesn't work properly

On 02/01/2012 03:13 PM, systemio systemio wrote:
> My function works about 7 seconds.
> i test my function via {timeout,100,[{setup,S,C,F}]} and always get timeout after 5 seconds.
> BUT if i test my function via {timeout,1,[{setup,S,C,F}]} i will get timeout after a second.

Yes, the {timeout,1,...} applies to the whole subset of tests, in this 
case the setup and all the tests in it. The individual tests still get 
their default timeout of 5 seconds. If you reduce the timeout for the 
whole group to 1 second, then that will of course happen first and abort 
all the tests in the group, while in the first case it's one of the 
individual tests that times out first. Only when applied to a single 
test does {timeout,T,...} change the timeout of the test itself.

I'm sorry that this is confusing. There should probably be a separate 
way of modifying the default timeout for all individual tests.

    /Richard
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

Picon
Picon

[Fwd: Re: ssh daemon and encoding.]

Hi!

Pressed the wrong reply-button!

Regards Ingela
Picon Picon
From: Ingela Anderton Andin <ingela <at> erix.ericsson.se>
Subject: Re: [erlang-bugs] ssh daemon and encoding.
Date: 2012-02-02 08:20:41 GMT
Hi!

Fyodor Ustinov wrote:
> On 01.02.2012 18:50, pan <at> erlang.org wrote:
>> Hi Erik!
> Can I expect that it will be seen as a bug and corrected in the next 
> version?

I think it is a bug and should be corrected along the lines that Patrik 
suggested.  I can not promise that we will be able to priorities it
in time for the next release though.  You can always submit a patch if 
you are in a hurry ;)

Regards Ingela Erlang/OTP team - Ericsson AB

>>
>> You are absolutely right about that 'user' and 'group' are used in 
>> different situations and that the names are utterly confusing. 
>> 'group' is used in *interactive shell sessions* and will determine 
>> unicode mode from LOCALE/terminal settings, while 'user' is for non 
>> interactive stdin/stdout (pipes, redirected files, dumb terminals 
>> etc), in which case you *have to* set unicode mode manually. Your 
>> first example will run the io:setopts before the group server is 
>> fully initialized, why you will get an unexpected behaviour. If you 
>> were to do the same when the interactive shell was actually started, 
>> the behaviour would be as expected.
>>
>> If opting to set unicode mode for an interactive session, set the 
>> LOCALE correctly. If running a non interactive session, use -oldshell 
>> or -noshell and do as in your second example.
>>
>> The problem reported however, was easilly found. It is due to that 
>> ssh_cli does not handle setting of unicode mode, which is a problem 
>> in the ssh application (that does not fully handle unicode). The 
>> internal protocol between io-server and ssh_cli will call 
>> ssh_cli:handle_msg({Pid,set_unicode_state,true},State), which is 
>> ignored by the ssh_cli code. Supporting unicode here could be done by 
>> simply expecting the terminal in the other end to support UTF8 
>> characters if unicode mode was enabled, which would be the same 
>> behaviour as in the 'user' io-server. That however requires a fair 
>> amount of coding and the ssh application is far away from my 
>> jurisdiction :)
>>
>> Cheers,
>> /Patrik, OTP
>>
>>
>> On Tue, 31 Jan 2012, Erik Søe Sørensen wrote:
>>
>>> This is probably not related to SSH.
>>> As was found out earlier on this list, the encoding behaviour 
>>> (confusingly) depends on how Erlang was started:
>>>
>>>   $ erl -eval 'ok = io:setopts([{encoding, unicode}]),
>>>   io:format("~p~n", [io:getopts()]), init:stop().'
>>>   Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:8:8] [rq:8]
>>>   [async-threads:0] [hipe] [kernel-poll:false]
>>>
>>>   Eshell V5.8.4  (abort with ^G)
>>>   1> [{expand_fun,#Fun<group.0.120017273>},
>>>     {echo,true},
>>>     {binary,false},
>>>     {encoding,latin1}]
>>>   $ erl -eval 'ok = io:setopts([{encoding, unicode}]),
>>>   io:format("~p~n", [io:getopts()]), init:stop().' -noinput
>>>   [{binary,false},{encoding,unicode}]
>>>   $ erl -eval 'ok = io:setopts([{encoding, unicode}]),
>>>   io:format("~p~n", [io:getopts()]), init:stop().' -noshell
>>>   [{binary,false},{encoding,unicode}]
>>>
>>> This has do do with the fact that in one case, the 'group' module 
>>> handles I/O, while in the other case it's the 'user' module.
>>> (I don't know enough to say anything intelligent about why this is, 
>>> why two modules with overlapping functionality but different 
>>> encoding behaviour exist, or what their purposes are besides 
>>> handling I/O.)
>>>
>>> On 31-01-2012 14:00, Fyodor Ustinov wrote:
>>>> Hi!
>>>>
>>>> Unable to set encoding to unicode in ssh daemon session.
>>>>
>>>> ok = io:setopts([{expand_fun, fun expand_prompt/1}, {encoding, 
>>>> unicode}]),
>>>> io:format("~p~n", [io:getopts()])
>>>>
>>>> say:
>>>>
>>>> [{expand_fun,#Fun<group.0.33302583>},
>>>>    {echo,true},
>>>>    {binary,false},
>>>>    {encoding,latin1}]
>>>>
>>>> WBR,
>>>>       Fyodor.
>>>>
>>>> _______________________________________________
>>>> erlang-bugs mailing list
>>>> erlang-bugs <at> erlang.org
>>>> http://erlang.org/mailman/listinfo/erlang-bugs
>>>
>>>
>>> -- 
>>> Mobile: + 45 26 36 17 55 | Skype: eriksoesorensen | Twitter: @eriksoe
>>> Trifork A/S  |  Margrethepladsen 4  |  DK-8000 Aarhus C | 
>>> www.trifork.com <http://www.trifork.com/>
>>>
>>
>>
>> _______________________________________________
>> erlang-bugs mailing list
>> erlang-bugs <at> erlang.org
>> http://erlang.org/mailman/listinfo/erlang-bugs
>>     
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs <at> erlang.org
> http://erlang.org/mailman/listinfo/erlang-bugs
>   

_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Samuel | 2 Feb 17:07
Picon
Gravatar

Re: eunit timeout doesn't work properly

> I'm sorry that this is confusing. There should probably be a separate way of
> modifying the default timeout for all individual tests.

I've shot my feet a number of times with that issue, but I always came
to think that even though it might be a bit confusing that you can set
a shorter timeout for a set of thests than for the tests themselves
and viceversa, once understood the behaviour is quite simple. Thus
never saw a point in fixing that.

However, the idea of modifying the default timeout could be handy, but
I'm not sure it can contribute to eliminate that confusion ...

Regards
--

-- 
Samuel
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

Andrew Thompson | 2 Feb 18:58
Picon
Gravatar

Re: eunit timeout doesn't work properly

On Wed, Feb 01, 2012 at 07:27:21PM +0100, Richard Carlsson wrote:
> I'm sorry that this is confusing. There should probably be a
> separate way of modifying the default timeout for all individual
> tests.

I'd love to see eunit timeouts be improved. I think at Basho we complain
about them at least once a week.

Andrew
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs


Gmane