[Bug 6913] New: wait-on-file expects /bin/sh is bash compatible

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Tue Sep 10 16:03:16 UTC 2024


https://bz.mercurial-scm.org/show_bug.cgi?id=6913

            Bug ID: 6913
           Summary: wait-on-file expects /bin/sh is bash compatible
           Product: Mercurial
           Version: 6.8.1
          Hardware: PC
                OS: Other
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: marcel at telka.sk
                CC: mercurial-devel at mercurial-scm.org
    Python Version: ---

I see ca 20 tests to fail with the same root cause (see below).

The problem seems to be that tests/testlib/wait-on-file expects the /bin/sh (in
its shebang) is bash compatible.  In my case the /bin/sh is ksh93 and so the
!(xxx) is always handled as a sub-pattern.  For bash the !(xxx) is recognized
only when the extglob shell option is enabled (which is apparently off by
default).

When I add a space between '!' and '(' on the affected line in
tests/testlib/wait-on-file then tests start to pass.


Typical error:

---
/data/builds/oi-userland/components/developer/mercurial/build/amd64-3.9/tests/test-dirstate-read-race.t
+++
/data/builds/oi-userland/components/developer/mercurial/build/amd64-3.9/tests/test-dirstate-read-race.t#dirstate-v1#pre-all-read.err
@@ -149,6 +149,7 @@
   > --config ${cfg}=$TESTTMP/status-race-lock \
   > &
   $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
+ 
/data/builds/oi-userland/components/developer/mercurial/build/amd64-3.9/tests/testlib/wait-on-file[32]:
!([ -e $TESTTMP/status-race-lock.waiting ] || [ -L
$TESTTMP/status-race-lock.waiting ]): not found [$ENOENT$]

 Add a file

@@ -220,6 +221,7 @@
   > --config ${cfg}=$TESTTMP/status-race-lock \
   > &
   $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
+ 
/data/builds/oi-userland/components/developer/mercurial/build/amd64-3.9/tests/testlib/wait-on-file[32]:
!([ -e $TESTTMP/status-race-lock.waiting ] || [ -L
$TESTTMP/status-race-lock.waiting ]): not found [$ENOENT$]

 Add a do a commit

@@ -293,6 +295,7 @@
   > --config ${cfg}=$TESTTMP/status-race-lock \
   > &
   $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
+ 
/data/builds/oi-userland/components/developer/mercurial/build/amd64-3.9/tests/testlib/wait-on-file[32]:
!([ -e $TESTTMP/status-race-lock.waiting ] || [ -L
$TESTTMP/status-race-lock.waiting ]): not found [$ENOENT$]
 do an update

   $ hg status
@@ -380,6 +383,7 @@
   > --config ${cfg}=$TESTTMP/status-race-lock \ 
   > & 
   $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
+ 
/data/builds/oi-userland/components/developer/mercurial/build/amd64-3.9/tests/testlib/wait-on-file[32]:
!([ -e $TESTTMP/status-race-lock.waiting ] || [ -L
$TESTTMP/status-race-lock.waiting ]): not found [$ENOENT$]
 do an update

   $ touch -t 200001020006 f

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list