Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overcome maximum path length on MacOS #208

Closed
j1n3l0 opened this issue Dec 7, 2020 · 1 comment
Closed

Overcome maximum path length on MacOS #208

j1n3l0 opened this issue Dec 7, 2020 · 1 comment

Comments

@j1n3l0
Copy link

j1n3l0 commented Dec 7, 2020

The following test:

use Test2::V0;
use Redis;
use Test::RedisServer;

subtest 'Redis' => sub {
    ok( lives { Redis->new( Test::RedisServer->new->connect_info ) },
        'should instantiate a new instance',
    ) || diag $@;
};

done_testing();

Passes when run with prove:

$ prove
t/overcome-max-length.t .. ok
All tests successful.
Files=1, Tests=1,  1 wallclock secs ( 0.02 usr  0.01 sys +  0.14 cusr  0.04 csys =  0.21 CPU)
Result: PASS

But fails when run with yath test:

$ yath test
( STDERR )  job  1    Path length (107) is longer than maximum supported length (104) and will be truncated at ${USER}.plenv/versions/5.30.0/lib/perl5/5.30.0/darwin-2level/Socket.pm line 872.
[  FAIL  ]  job  1  +~Redis
[  FAIL  ]  job  1    + should instantiate a new instance
(  DIAG  )  job  1    | Failed test 'should instantiate a new instance'
(  DIAG  )  job  1    | at t/overcome-max-length.t line 7.
(  DIAG  )  job  1    | Could not connect to Redis server at /private/var/folders/_w/q9blb5897bz8510mt67v55180000gn/T/yath-84725-978I5b/tmp/RhpQpq/2jw9bD9epA/redis.sock: No such file or directory at t/overcome-max-length.t line 6.
            job  1    ^
(  DIAG  )  job  1    Failed test 'Redis'
(  DIAG  )  job  1    at t/overcome-max-length.t line 9.
(  DIAG  )  job  1    Seeded srand with seed '20201207' from local date.
( FAILED )  job  1    t/overcome-max-length.t
< REASON >  job  1    Test script returned error (Err: 1)
< REASON >  job  1    Assertion failures were encountered (Count: 1)
< REASON >  job  1    Subtest failures were encountered (Count: 1)

The following jobs failed:
+--------------------------------------+-------------------------+
| Job ID                               | Test File               |
+--------------------------------------+-------------------------+
| 721316B0-3875-11EB-A450-CCA1D99EEF75 | t/overcome-max-length.t |
+--------------------------------------+-------------------------+

                                Yath Result Summary
-----------------------------------------------------------------------------------
     Fail Count: 1
     File Count: 1
Assertion Count: 2
      Wall Time: 0.81 seconds
       CPU Time: 1.03 seconds (usr: 0.31s | sys: 0.05s | cusr: 0.53s | csys: 0.14s)
      CPU Usage: 127%
    -->  Result: FAILED  <--

The problem appears to be that the socket returned by Test::RedisServer->new->connect_info has a path that is too long on a MacOS (10.14.6).

I don't understand why there is a difference between prove and yath test in this instance though.

@j1n3l0
Copy link
Author

j1n3l0 commented Dec 7, 2020

Right, so it seems the issue might be that Test2-Harness sets its own TMPDIR. I noticed it might be doing that when I saw #185. Overriding it to something shorter appears to do the trick:

$ TMPDIR=/tmp yath test
( PASSED )  job  1    t/overcome-max-length.t

                                Yath Result Summary
-----------------------------------------------------------------------------------
     File Count: 1
Assertion Count: 2
      Wall Time: 0.65 seconds
       CPU Time: 0.88 seconds (usr: 0.21s | sys: 0.04s | cusr: 0.50s | csys: 0.13s)
      CPU Usage: 134%
    -->  Result: PASSED  <--

Not sure now if this is a problem.

@j1n3l0 j1n3l0 closed this as completed Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant