[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#916087: lintian: "exec failed: Text file busy" when running tests by tag



Chris,

On Sun, Dec 9, 2018 at 1:57 PM Chris Lamb <lamby@debian.org> wrote:

> I think your recent commits have introduced a regression in the test
> harness:

They sure did. (Although they worked fine in my new runner.)

> exec failed: Text file busy at /home/lamby/git/debian/lintian/lintian/lib/Lintian/Command.pm line 274.
>    at /home/lamby/git/debian/lintian/lintian/lib/Lintian/Command.pm line 274.
>    at t/runtests line 482.

Using plain qx{}, this message turns into "Can't exec
"/lcl/lechner/lintian/git/debian/test-out/tests/scripts-maintainer-general/post_template":
Text file busy at t/runtests line 482."

After substantial investigation (and consultation with #perl-help), I
believe the close function in
`lib/Test/Lintian/Templates.pm::fill_template did not close the
generated file 'post_template'.

https://salsa.debian.org/lintian/lintian/blob/master/lib/Test/Lintian/Templates.pm#L273

When run immediately afterward, the command 'lsof' shows the file
post_template (and other files generated in that function) as open
even after the call to close(). The process ID matched that of the
thread, so no other thread kept it open. ($$ is the number before
COMMAND.)

$ debian/rules runtests onlyrun=tag:uses-dpkg-database-directly
.... running tests ....
mkdir -p "/lcl/lechner/lintian/git/debian/test-out"
t/runtests -k  t "/lcl/lechner/lintian/git/debian/test-out"
tag:uses-dpkg-database-directly
ENV[PATH]=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Running 3 tests.

error tests::scripts-maintainer-general: 8061: COMMAND
  PID    USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
Test\x20worker\x20-\x20p 8061 lechner    8w   REG  253,0      122
1050553 /lcl/lechner/lintian/git/debian/test-out/tests/scripts-maintainer-general/post_template

error tests::legacy-maintainer-scripts: 8063: COMMAND
 PID    USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
Test\x20worker\x20-\x20p 8063 lechner    8w   REG  253,0      122
1050557 /lcl/lechner/lintian/git/debian/test-out/tests/legacy-maintainer-scripts/post_template

pass tests::files-uses-dpkg-database-directly

Failed tests (2)
    tests::scripts-maintainer-general
    tests::legacy-maintainer-scripts
make: *** [debian/rules:51: runtests] Error 1

A solution was proposed as merge request !89. It reuses skeletons as
suite-based defaults. The watch file is now provided from there. For
more information, please see the commit messages.

The active template idea was scrapped. The current scheme is probably better.

> ie. Only when running tests by tag name, even if it's the same test.

While I also observed this, I was unable to tie the "tag" selector to
the error. I even backported a new test selection mechanism; the error
remained. With a solution pending, the relationship was not
investigated further.

Kind regards,
Felix


Reply to: