jsimonet / log-any

Perl6 logging library (port of Perl5 Log::Any)
Artistic License 2.0
2 stars 5 forks source link

tests fail on appveyor #3

Open ufobat opened 7 years ago

ufobat commented 7 years ago
===> Testing: Log::Any:ver('0.9.3')
t/01-meta6.t ........... ok
t/02-basic.t ........... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/32 subtests 
t/02-multi-thread.t .... ok
t/03-filters.t ......... ok
t/04-asynchronicity.t .. ok
Test Summary Report
-------------------
t/02-basic.t         (Wstat: 256 Tests: 32 Failed: 1)
  Failed test:  31
  Non-zero exit status: 1
Files=5, Tests=69,  6 wallclock secs ( 0.05 usr +  0.00 sys =  0.05 CPU)
Result: FAIL
# Failed test 'Log DateTime is not in the interval'
# at t/02-basic.t line 70
# Looks like you failed 1 test of 32
===> Testing [FAIL]: Log::Any:ver('0.9.3')
Aborting due to test failure: Log::Any:ver('0.9.3') (use --force-test to override)
  in code  at C:\Users\appveyor\rakudobrew\moar-2017.06\install\share\perl6\site\sources\58A2CF7B6756361E028457049819328DE7AF8AD8 (Zef::Client) line 373
  in method test at C:\Users\appveyor\rakudobrew\moar-2017.06\install\share\perl6\site\sources\58A2CF7B6756361E028457049819328DE7AF8AD8 (Zef::Client) line 351
  in code  at C:\Users\appveyor\rakudobrew\moar-2017.06\install\share\perl6\site\sources\58A2CF7B6756361E028457049819328DE7AF8AD8 (Zef::Client) line 528
  in sub  at C:\Users\appveyor\rakudobrew\moar-2017.06\install\share\perl6\site\sources\58A2CF7B6756361E028457049819328DE7AF8AD8 (Zef::Client) line 525
  in method install at C:\Users\appveyor\rakudobrew\moar-2017.06\install\share\perl6\site\sources\58A2CF7B6756361E028457049819328DE7AF8AD8 (Zef::Client) line 631
  in sub MAIN at C:\Users\appveyor\rakudobrew\moar-2017.06\install\share\perl6\site\sources\B9B6B5F22DE3727E789C70B98CFB4A5030EE58D8 (Zef::CLI) line 152
  in block <unit> at C:\Users\appveyor\rakudobrew\moar-2017.06\install\share\perl6\site\resources\781A78D3FE358EE90D60E4633882482D3AE9D3A5 line 1
Emeric54 commented 7 years ago

On my local Windows machine, all tests pass. The failing test is here.

Emeric54 commented 7 years ago

It appears that .... the AppVeyor CI server is too fast !

my $before-log = DateTime.new( now );
Log::Any.log( :pipeline( 'test-2' ), :msg('test-2'), :severity( 'trace' ), :category( 'test-category' ) );
my $after-log = DateTime.new( now );

with $a.logs[*-1] {
    like $_, /^ (<-[\s]>+) \s 'trace test-category test-2' $/, 'Log with formatter in test-2 pipeline';
    # Check if log dateTime is after $before-log, and before $after-log
    with $_ ~~ /^ (<-[\s]>+)/ {
        my $log-dateTime = DateTime.new( $_.Str );
        say $before-log;
        say $log-dateTime;
        say $after-log;
        if $before-log < $log-dateTime < $after-log {
            pass "Log DateTime is in the interval";
        } else {
            flunk "Log DateTime is not in the interval";
        }
    } else {
        flunk "Failed to extract dateTime from log message";
    }
} else {
    flunk 'Log with formatter in test-2 pipeline';
}

executed by the CI server :

2017-06-29T15:11:17.805007Z
2017-06-29T15:11:17.805007Z
2017-06-29T15:11:17.805007Z
not ok 31 - Log DateTime is not in the interval