skaji / Mac-FSEvents

https://metacpan.org/dist/Mac-FSEvents
Other
0 stars 0 forks source link

Tests fail with Perl 5.34 and Perl 5.38 #7

Open ballapete opened 2 weeks ago

ballapete commented 2 weeks ago

Executing: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_perl_p5-mac-fsevents/p5.34-mac-fsevents/work/Mac-FSEvents-0.22" && /usr/bin/make test "/opt/local/bin/perl5.34" -MExtUtils::Command::MM -e 'cp_nonempty' -- FSEvents.bs blib/arch/auto/Mac/FSEvents/FSEvents.bs 644 PERL_DL_NONLAZY=1 "/opt/local/bin/perl5.34" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/.t

ProductName: Mac OS X

ProductVersion: 10.13.6

BuildVersion: 17G14042

Machine: x86_64

t/00report.t ............... ok t/01use.t .................. ok t/02constructor.t .......... ok t/03event.t ................ ok

#   Failed test at t/04flags.t line 65.
#          got: '1'
#     expected: '2'
# Looks like you failed 1 test of 2.

Failed test 'none'

at t/04flags.t line 67.

Looks like you failed 1 test of 4.

t/04flags.t ................ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/4 subtests t/05fork.t ................. ok t/06receive-all-changes.t .. ok

Test Summary Report

t/04flags.t (Wstat: 256 (exited 1) Tests: 4 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=7, Tests=15, 19 wallclock secs ( 0.05 usr 0.02 sys + 2.60 cusr 2.30 csys = 4.97 CPU) Result: FAIL Failed 1/7 test programs. 1/15 subtests failed.

And similarly:

Executing: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_perl_p5-mac-fsevents/p5.38-mac-fsevents/work/Mac-FSEvents-0.22" && /usr/bin/make test "/opt/local/bin/perl5.38" -MExtUtils::Command::MM -e 'cp_nonempty' -- FSEvents.bs blib/arch/auto/Mac/FSEvents/FSEvents.bs 644 PERL_DL_NONLAZY=1 "/opt/local/bin/perl5.38" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/.t

ProductName: Mac OS X

ProductVersion: 10.13.6

BuildVersion: 17G14042

Machine: x86_64

t/00report.t ............... ok t/01use.t .................. ok t/02constructor.t .......... ok t/03event.t ................ ok

#   Failed test at t/04flags.t line 65.
#          got: '1'
#     expected: '2'
# Looks like you failed 1 test of 2.

Failed test 'none'

at t/04flags.t line 67.

Looks like you failed 1 test of 4.

t/04flags.t ................ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/4 subtests t/05fork.t ................. ok t/06receive-all-changes.t .. ok

Test Summary Report

t/04flags.t (Wstat: 256 (exited 1) Tests: 4 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=7, Tests=15, 19 wallclock secs ( 0.05 usr 0.01 sys + 2.59 cusr 2.18 csys = 4.83 CPU) Result: FAIL Failed 1/7 test programs. 1/15 subtests failed. make: *** [test_dynamic] Error 255

skaji commented 1 day ago

Thank you for the report.

However, I was unable to reproduce the test failure on my local environment or on GitHub Actions. Can you test if the test failure is resolved after applying the following patch?

diff --git t/04flags.t t/04flags.t
index adbbdf8..44849cd 100644
--- t/04flags.t
+++ t/04flags.t
@@ -50,6 +50,7 @@ subtest 'none' => sub {
     my $tmpdir = File::Temp->newdir;
     my $tmp_abs = abs_path( "$tmpdir" );

+    sleep 2;
     my $fs = Mac::FSEvents->new({
         path    => "$tmpdir",
         latency => $TEST_LATENCY,
ballapete commented 1 day ago

Looks a bit better now:

--->  Testing p5.34-mac-fsevents
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_perl_p5-mac-fsevents/p5.34-mac-fsevents/work/Mac-FSEvents-0.22" && /usr/bin/make test 
"/opt/local/bin/perl5.34" -MExtUtils::Command::MM -e 'cp_nonempty' -- FSEvents.bs blib/arch/auto/Mac/FSEvents/FSEvents.bs 644
PERL_DL_NONLAZY=1 "/opt/local/bin/perl5.34" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# 
# ProductName:  Mac OS X
# ProductVersion:   10.13.6
# BuildVersion: 17G14042
# Machine:  x86_64
t/00report.t ............... ok
t/01use.t .................. ok
t/02constructor.t .......... ok
t/03event.t ................ ok

    #   Failed test at t/04flags.t line 65.
    #          got: '1'
    #     expected: '2'
    # Looks like you failed 1 test of 2.

#   Failed test 'none'
#   at t/04flags.t line 67.
# Looks like you failed 1 test of 4.
t/04flags.t ................ 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests 
t/05fork.t ................. ok
t/06receive-all-changes.t .. ok

Test Summary Report
-------------------
t/04flags.t              (Wstat: 256 Tests: 4 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=7, Tests=15, 23 wallclock secs ( 0.07 usr  0.03 sys +  2.69 cusr  2.43 csys =  5.22 CPU)
Result: FAIL
Failed 1/7 test programs. 1/15 subtests failed.
ballapete commented 1 day ago

Sorry! I made a mistake, actually two: Your patch does not get yet applied and I did a comparison with the wrong saved file.

ballapete commented 1 day ago

I am performing thing inside the port based (https://en.wikipedia.org/wiki/Ports_collection) MacPorts (https://en.wikipedia.org/wiki/MacPorts) package manager. First your patch gets applied:

--->  Applying patch-04flags-test.diff

and then, after configuration (/opt/local/bin/perl5.34 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang"), an automatic patch set gets applied to fix C code compilation in Makefile.PL:

Fixing flags in Makefile
--->  Patching Makefile: /^CCFLAGS *=/s|$| -arch x86_64 -isysroot/|
--->  Patching Makefile: /^OTHERLDFLAGS *=/s|$| -arch x86_64 -Wl,-syslibroot,/|
--->  Patching Makefile: s|^(CC *=).*|\1 /usr/bin/clang|

The result is that now the bug happens one line of code later:

t/03event.t ................ ok

    #   Failed test at t/04flags.t line 66.
    #          got: '1'
    #     expected: '2'
    # Looks like you failed 1 test of 2.

#   Failed test 'none'
#   at t/04flags.t line 68.
# Looks like you failed 1 test of 4.
t/04flags.t ................ 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests 
t/05fork.t ................. ok

I am going to try the tests on a more up-to-date system…

ballapete commented 1 day ago

On macOS Sonoma compilation emits many warnings, but build succeeds and test too:

# ProductName:      macOS
# ProductVersion:       14.7.1
# BuildVersion:     23H222
# Machine:  x86_64
t/00report.t ............... ok
t/01use.t .................. ok
t/02constructor.t .......... ok
t/03event.t ................ ok
t/04flags.t ................ ok
t/05fork.t ................. ok
t/06receive-all-changes.t .. ok
All tests successful.
Files=7, Tests=15, 19 wallclock secs ( 0.04 usr  0.03 sys +  1.91 cusr  3.16 csys =  5.14 CPU)
Result: PASS
skaji commented 1 day ago

Thank you for trying. So "sleep 2" does not fix test failures in Mac OS X 10.13.6. Since I only have a macOS 15 environment, further investigation is difficult for me.

ballapete commented 1 day ago

I am no Perl programmer – but I can execute commands! Another option would be to insert print statements or such into the test files which I then substitute with the proper ones and report the output here? I can also write the recipe files for MacPorts to install and test new Perl modules that might help to debug the issue – I just need to be told! (Actually 20 years ago I tried to find something to debug Perl scripts, making Perl interpret the script line by line or statement by statement – is this possible today? But since I am retired from system administration I do not think that I would become interested in Perl again… Right now I am checking for MacPorts whether Perl 5.38 would be a good substitute for Perl 5.34 and will have the same – or some more, or some less – issues testing modules.)