-
Notifications
You must be signed in to change notification settings - Fork 577
PathTools: t/cwd_enoent.t fails in docker #16699
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
Comments
From @eserteThis is a bug report for perl from slaven@rezic.de, t/cwd_enoent.t fails if run in a docker container: ... # Failed test 'perl abs_path errno on non-existent directory' It seems to fail also in other environments --- see In both cases stat(.) returns ESTALE instead of the expected ENOENT. $ docker run -it ubuntu:bionic bash Maybe the test only needs slight adaption to accept both errno codes. Flags: Site configuration information for perl 5.20.2: Configured by Debian Project at Mon Sep 18 18:13:32 UTC 2017. Summary of my perl5 (revision 5 version 20 subversion 2) configuration: Locally applied patches: @INC for perl 5.20.2: Environment for perl 5.20.2: |
From @eserteDana Thu, 20 Sep 2018 07:10:47 -0700, slaven@rezic.de reče:
A possible patch is attached. |
From @eserte0001-accept-also-ESTALE-fix-for-RT-133534.patchFrom 1216af32d5f2ddb5b13507dce592acbc33e33c24 Mon Sep 17 00:00:00 2001
From: Slaven Rezic <[email protected]>
Date: Tue, 2 Oct 2018 15:39:48 +0200
Subject: [PATCH] accept also ESTALE (fix for RT #133534)
ESTALE may occur in some environments when accessing a
now non-existing directory, e.g. when using NFS or in docker
containers.
---
t/cwd_enoent.t | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/t/cwd_enoent.t b/t/cwd_enoent.t
index 8f3a1fb..510c65e 100644
--- a/t/cwd_enoent.t
+++ b/t/cwd_enoent.t
@@ -2,7 +2,7 @@ use warnings;
use strict;
use Config;
-use Errno qw(ENOENT);
+use Errno qw();
use File::Temp qw(tempdir);
use Test::More;
@@ -19,6 +19,7 @@ unless(mkdir("$tmp/testdir") && chdir("$tmp/testdir") && rmdir("$tmp/testdir")){
plan tests => 8;
require Cwd;
+my @acceptable_errnos = (&Errno::ENOENT, (defined &Errno::ESTALE ? &Errno::ESTALE : ()));
foreach my $type (qw(regular perl)) {
SKIP: {
skip "_perl_abs_path() not expected to work", 4
@@ -36,12 +37,14 @@ foreach my $type (qw(regular perl)) {
$res = Cwd::getcwd();
$eno = 0+$!;
is $res, undef, "$type getcwd result on non-existent directory";
- is $eno, ENOENT, "$type getcwd errno on non-existent directory";
+ ok((grep { $eno == $_ } @acceptable_errnos), "$type getcwd errno on non-existent directory")
+ or diag "Got errno code $eno, expected " . join(", ", @acceptable_errnos);
$! = 0;
$res = Cwd::abs_path(".");
$eno = 0+$!;
is $res, undef, "$type abs_path result on non-existent directory";
- is $eno, ENOENT, "$type abs_path errno on non-existent directory";
+ ok((grep { $eno == $_ } @acceptable_errnos), "$type abs_path errno on non-existent directory")
+ or diag "Got errno code $eno, expected " . join(", ", @acceptable_errnos);
}
}
--
2.7.4
|
From @jkeenanOn Tue, 02 Oct 2018 13:43:10 GMT, slaven@rezic.de wrote:
I had to manually apply the patch because it was created against ./dist/PathTools rather than against . (the top of the core distribution). Please check. It's now available for smoking in this branch: smoke-me/jkeenan/slaven/133534-path-tools Anyone who can test the branch inside a docker container, please do so. Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @eserteDana Wed, 03 Oct 2018 07:21:15 -0700, jkeenan reče:
Actually I did not report against perl5, but against the CPAN distribution PathTools, and did also the patch against the cpan dist. Unfortunately the issue tracker is the same for both.
Here's a Dockerfile to test this. You can swap the git-clone commands to verify that blead fails on this test file. # docker build -t perl-test . && docker run perl-test |
From @jkeenanOn 10/04/2018 05:25 AM, slaven@rezic.de via RT wrote:
Is there anyone with both docker and a git checkout of blead who could Thank you very much. |
From @eserteDana Thu, 04 Oct 2018 11:57:43 -0700, jkeenan@pobox.com reče:
Only docker needed. The Dockerfile cares for the git checkout itself. |
From @jkeenanOn Thu, 04 Oct 2018 19:28:02 GMT, slaven@rezic.de wrote:
1. General: Would it be possible to set up a reusable smoke-testing rig for Docker? 2. Specific: I placed the text you posted in a file called Dockerfile and then issued this command: ##### It appears to have built a container, built perl, but quit before 'make test'. ##### What went wrong? What do I do here? -- |
From @eserte"James E Keenan via RT" <perlbug-followup@perl.org> writes:
Probably. You just have to take care of docker's caching --- use it if
The "docker run" command also needs sudo. Or, for more convenience, you can add your unix user to the "docker" Regards, -- Berlin Perl Mongers - http://berlin.pm.org |
From @jkeenanOn Thu, 04 Oct 2018 21:10:43 GMT, slaven@rezic.de wrote:
Pushed to blead in commit commit 8508806. Thanks to Mithaldu_ and Getty on #toolchain for getting this tested in a Docker environment. -- |
@jkeenan - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#133534 (status was 'resolved')
Searchable as RT133534$
The text was updated successfully, but these errors were encountered: