Patchwork [stable] tests: use an absolute path to get around '..' being invalid on a dead CWD

login
register
mail settings
Submitter Augie Fackler
Date Jan. 19, 2017, 9:35 p.m.
Message ID <34923f3f218573ec5757.1484861714@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/18267/
State Accepted
Headers show

Comments

Augie Fackler - Jan. 19, 2017, 9:35 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1484861029 18000
#      Thu Jan 19 16:23:49 2017 -0500
# Branch stable
# Node ID 34923f3f218573ec57575f4ae59cb4198cc6a313
# Parent  b3d2e8cce78c04dbf6f20f0846b6ea8b622983c4
tests: use an absolute path to get around '..' being invalid on a dead CWD

Only FreeBSD seems to be this picky. Note that this explicit
absolute-path `cd` exposes a defect in the test, in that we end up
still inside the cwd-vanish repository, but that's not a regression in
this change. Since we're in a code freeze, I'm doing the smallest
thing possible to try and fix bugs on FreeBSD, rather than cleaning up
the entire problem. I'll follow up with a more complete fix after the
freeze.
Sean Farley - Jan. 19, 2017, 9:44 p.m.
Augie Fackler <raf@durin42.com> writes:

> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1484861029 18000
> #      Thu Jan 19 16:23:49 2017 -0500
> # Branch stable
> # Node ID 34923f3f218573ec57575f4ae59cb4198cc6a313
> # Parent  b3d2e8cce78c04dbf6f20f0846b6ea8b622983c4
> tests: use an absolute path to get around '..' being invalid on a dead CWD
>
> Only FreeBSD seems to be this picky. Note that this explicit
> absolute-path `cd` exposes a defect in the test, in that we end up
> still inside the cwd-vanish repository, but that's not a regression in
> this change. Since we're in a code freeze, I'm doing the smallest
> thing possible to try and fix bugs on FreeBSD, rather than cleaning up
> the entire problem. I'll follow up with a more complete fix after the
> freeze.

I guess so ... crazy freebsd.
Augie Fackler - Jan. 20, 2017, 2:40 a.m.
> On Jan 19, 2017, at 4:44 PM, Sean Farley <sean@farley.io> wrote:
> 
> I guess so ... crazy freebsd.

I had another thought on the way home: this might only be a problem in a jail - it’s not the first bit of strange behavior we’ve caught with hg when running in my buildbot-in-a-jail.

In any event, I think this fixes the last test failure on the BSD builder.
Yuya Nishihara - Jan. 20, 2017, 1:43 p.m.
On Thu, 19 Jan 2017 16:35:14 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1484861029 18000
> #      Thu Jan 19 16:23:49 2017 -0500
> # Branch stable
> # Node ID 34923f3f218573ec57575f4ae59cb4198cc6a313
> # Parent  b3d2e8cce78c04dbf6f20f0846b6ea8b622983c4
> tests: use an absolute path to get around '..' being invalid on a dead CWD

Looks good, queued, thanks.

Patch

diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t
--- a/tests/test-rebase-scenario-global.t
+++ b/tests/test-rebase-scenario-global.t
@@ -770,9 +770,13 @@  Test that rebase is not confused by $CWD
   saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-backup.hg (glob)
 #endif
 
+Get back to the root of cwd-vanish. Note that even though `cd ..`
+works on most systems, it does not work on FreeBSD 10, so we use an
+absolute path to get back to the repository.
+  $ cd $TESTTMP/cwd-vanish
+
 Test that rebase is done in topo order (issue5370)
 
-  $ cd ..
   $ hg init order
   $ cd order
   $ touch a && hg add a && hg ci -m A