On 2015-12-01 10:29:33, ISAACSON wrote:
Show quoted text> Thank you for your bug report. This is actually the expected result
> though.
>
> Rstat::Client is a client module for querying a remote rstatd. It
> would be nice for the test suite to make a query to confirm that
> everything is working... but where can it expect to find a running
> rstatd?
>
> There's no answer that will work in every environment, so it looks for
> one on localhost. If this fails, how do you distinguish between (a)
> rstatd doesn't happen to be running on localhost, and (b) rstatd is
> running but there's something wrong with the module?
>
> I asked this question on cpan-testers before releasing the module, and
> their suggestion was for this failure not to be fatal. Given the
> simplicity of the module, any runtime failure is likely to be caused
> by rstatd not running, and it would be misleading to fill the test
> history up with FAIL results for this reason. So if test 3 is the only
> one that fails, then the test suite will still pass.
There are possibilities to express such things in the TAP protocol. For example, you can mark this test case as a TODO test --- maybe you find a way to check for the existence of a running rstatd to make the test more reliable. If you're using Test::More then you can do it like this:
{
local $TODO = "May fail if there's no rstatd daemon running";
ok connect_to_rstatd(), "check rstatd connection";
}
Or you could just skip things:
SKIP: {
skip "Probably no rstatd daemon running", 1
if !connect_to_rstatd();
... another test using rstatd ...
}
Or just print some diagnostic message:
if (!connect_to_rstatd()) {
diag 'Can't connect to rstatd, maybe the daemon is not running';
} else {
pass 'connect to rstatd';
}
Additionally you can make it possible (e.g. through the use of environment variables) to make such a failure fatal for users who know that they are running a rstatd daemon.
In any case you should check the other RT ticket about converting the test.pl script into a "modern" t/*.t script.
Show quoted text>
> It would probably be nice to show a message in this case, so that if
> anyone is looking at the test output, they understand what's
> happening.
>
> Please let me know if you have any issues using the module!
Well, actually I am not a user of the module, but stumbled over random test failures in Rstat-Client while checking for possible regressions in newer perl versions (5.22.1, 5.23.5).
See
http://matrix.cpantesters.org/?dist=Rstat-Client%202.2 for the list of failures. I think the fails happen because the tests are hanging.