Skip to content

CPAN breaks blead: Change in Test-Simple would cause test failure dist/PathTools #23164

@jkeenan

Description

@jkeenan

Today I attempted to synch CPAN distribution Test-Simple-1.302210 into blead at 3ab0369:

$ perl Porting/synch-with-cpan Test::Simple --yes

The program executed without difficulty; you can see the resulting code here. The most relevant changes can be found in https://github.com/Perl/perl5/compare/blead...jkeenan:perl5:synch-test-simple-20250331?expand=1#diff-d39e6642c9e2bdbd92225d87ce19c560caf9c404f420045aed7aefc1b867257b
and
https://github.com/Perl/perl5/compare/blead...jkeenan:perl5:synch-test-simple-20250331?expand=1#diff-d83f7e66bba7f8752334cd671971a17cb10b2bec768dbbf2882cf73d7e018e91. The program runs the tests under cpan/Test-Simple; they all PASS.

However, when I run make test_harness I get the following failure in a different distro shipped with the core:

$ cd t; ./perl harness  -v ../dist/PathTools/t/cwd_enoent.t; cd -
Can't locate Config_heavy.pl in @INC (@INC entries checked: ../../lib ../../t) at ../../lib/Config.pm line 80.
# Looks like your test exited with 2 just after 4.

ok 1 - regular getcwd result on non-existent directory
ok 2 - regular getcwd errno on non-existent directory
ok 3 - regular abs_path result on non-existent directory
ok 4 - regular abs_path errno on non-existent directory
Dubious, test returned 2 (wstat 512, 0x200)
Failed 4/8 subtests 

Test Summary Report
-------------------
../dist/PathTools/t/cwd_enoent.t (Wstat: 512 (exited 2) Tests: 4 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 8 tests but ran 4.
Files=1, Tests=4,  0 wallclock secs ( 0.00 usr  0.00 sys +  0.03 cusr  0.00 csys =  0.03 CPU)
Result: FAIL

The expected output for this test file is this:

ok 1 - regular getcwd result on non-existent directory
ok 2 - regular getcwd errno on non-existent directory
ok 3 - regular abs_path result on non-existent directory
ok 4 - regular abs_path errno on non-existent directory
ok 5 - perl getcwd result on non-existent directory
ok 6 - perl getcwd errno on non-existent directory
ok 7 - perl abs_path result on non-existent directory
ok 8 - perl abs_path errno on non-existent directory

After considerable re-testing to reproduce the problem in other checkouts and on a different platform, I went to Test-Simple's GH repository and examined the individual commits to that codebase that went into CPAN version 1.302210. The following commit caught my attention because its commit message mentions Config_heavy.pl -- the file not found in @INC in the failing test in Perl 5 blead.

commit 1653a15c33673a63a5c2b56bed4d10b0c8d32dfc
Author:     Graham Knop <[email protected]>
AuthorDate: Sat Mar 29 07:15:22 2025
Commit:     Graham Knop <[email protected]>
CommitDate: Sat Mar 29 07:26:11 2025

    calculate CAN_SIGSYS when called rather than as a constant

    CAN_SIGSYS is not used by Test2 anymore since the removal of the shm
    code in 4c1bdd27e7f7694cbdfe4ec83b79b1cf791b4bc5. It is however still
    used by Test2::Harness.
    
    %Config has magic behavior where some values exist in Config.pm, and
    others need to load Config_heavy.pl. Checking the sig_name value will
    always force Config_heavy.pl to be loaded. Since CAN_SIGSYS is mostly
    not used, having it always force loading the heavy config provides a
    minor slowdown of loading Test::More. We can provide the function as a
    runtime check rather than a constant to avoid this.

If I now return to the branch in my checkout of the core in which I am attempting to bring in Test-Simple and revert the changes from test-more-1653a15c33673a63a5c2b56bed4d10b0c8d32dfc, all tests in dist/PathTools/t/cwd_enoent.t once again PASS.

I don't understand why a test under dist/PathTools would be so affected by a change in a module under cpan/Test-Simple.

@haarg, can you take a look? Thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions