Merge ~ubuntu-release/autopkgtest/+git/development:hide-warnings into ~ubuntu-release/autopkgtest/+git/development:master

Proposed by Brian Murray
Status: Approved
Approved by: Steve Langasek
Approved revision: 01bff8e8d49ace511c1fe81695fbf188528dfb2a
Proposed branch: ~ubuntu-release/autopkgtest/+git/development:hide-warnings
Merge into: ~ubuntu-release/autopkgtest/+git/development:master
Diff against target: 13 lines (+1/-1)
1 file modified
lib/adt_testbed.py (+1/-1)
Reviewer Review Type Date Requested Status
Brian Murray Needs Fixing
Steve Langasek Approve
Tim Andersson (community) Approve
Review via email: mp+457169@code.launchpad.net

Description of the change

We were seeing issues on arm64 test instances where tests would fail immediately after running the following commands:

112s autopkgtest [18:56:44]: ERROR: "sh -ec mkdir -p /etc/apt/preferences.d; PKGS=""; PKGS="$PKGS $(apt-cache showsrc binutils | awk '/^Package-List:/ { show=1; next } (/^ / && show==1) { print $1 ":*"; next } { show=0 }' |sort -u | tr '\n' ' ')"; printf "Package: $PKGS\nPin: release a=noble-proposed\nPin-Priority: 995\n" > /etc/apt/preferences.d/autopkgtest-noble-proposed; printf "
112s Package: *\nPin: release a=noble-updates\nPin-Priority: 990\n" >> /etc/apt/preferences.d/autopkgtest-noble-proposed; " failed with stderr "W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list.d/ubuntu.sources:1

The problem was that $PKGS contained warning messages and then some how this tried as a command:

binutils-aarch64-linux-gnu-dbg:*: command not found

There seems to be a problem with our images in that we have /etc/apt/sources.list and /etc/apt/sources.list.d/ubuntu.sources which needs investigating. However, we should get arm64 (and other arches?) tests running again while we investigate the root cause of the issue.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :
Revision history for this message
Simon Quigley (tsimonq2) wrote :

You're probably looking for https://discourse.ubuntu.com/t/spec-apt-deb822-sources-by-default/29333/11

This will be an issue until the appropriate tooling is fixed. Until then, looks like we have both.

Revision history for this message
Steve Langasek (vorlon) wrote :

As I understand it the code currently fails because there is output on stderr.

But by redirecting stderr to stdout (2>&1), there will now be no output on stderr. So if we intend to detect and fail on other error output, this prevents that.

Revision history for this message
Steve Langasek (vorlon) wrote :

Here is a horrible shell pipeline that filters out only 'W: ' lines from stderr, and then puts the rest of stdout and stderr back on the file descriptors where it's supposed to be.

(apt-cache showsrc e2fsprogs 3>&1 1>&2 2>&3 3>&- | grep -v ^W: ) 3>&1 1>&2 2>&3 3>&-

review: Needs Fixing
Revision history for this message
Steve Langasek (vorlon) wrote :

I suggest filing a bug against apt about not having any way to suppress warning messages on stderr.

Revision history for this message
Paride Legovini (paride) wrote :

That `apt-cache showsrc | awk` logic is gone in newer versions of autopkgtest:

https://salsa.debian.org/ci-team/autopkgtest/-/commit/39290ef8c66d4d2362720383643fd32cf88bf2a7

I'm working at merging that latest Debian version of autopkgtest, however there are plenty of conflicts with our cross architecture testing patchset, so this is not a trivial merge.

01bff8e... by Brian Murray

Use Steve's horrible shell pipeline

Revision history for this message
Brian Murray (brian-murray) wrote :

Both versions return the same results:

ubuntu@creation-test-amd64-1:~$ (apt-cache showsrc e2fsprogs 3>&1 1>&2 2>&3 3>&- | grep -v ^W: ) 3>&1 1>&2 2>&3 3>&- | awk '/^Package-List:/ { show=1; next } (/^ / && show==1) { print $1 ":*"; next } { show=0 }' | sort -u | tr '\\n' ' '
comerr-dev:*
e2fsck-static:*
e2fsprogs-l10 :*
e2fsprogs-udeb:*
e2fsprogs:*
fuse2fs:*
libcom-err2:*
libext2fs-dev:*
libext2fs2:*
libss2:*
logsave:*
ss-dev:*
ubuntu@creation-test-amd64-1:~$ apt-cache showsrc e2fsprogs 2>&1 | grep -v ^W: | awk '/^Package-List:/ { show=1; next } (/^ / && show==1) { print $1 ":*"; next } { show=0 }' | sort -u | tr '\\n' ' '
comerr-dev:*
e2fsck-static:*
e2fsprogs-l10 :*
e2fsprogs-udeb:*
e2fsprogs:*
fuse2fs:*
libcom-err2:*
libext2fs-dev:*
libext2fs2:*
libss2:*
logsave:*
ss-dev:*

Revision history for this message
Steve Langasek (vorlon) wrote :

Just to confirm, yes, the output should be identical between the two commands when there are no other sources of stderr messages

Revision history for this message
Tim Andersson (andersson123) wrote :

If the most recent commit gets squashed, this LGTM. I know Paride mentioned when merging our branch with upstream, this code is completely different already, but I think this is a valuable patch that we could carry for the time being.

review: Approve
Revision history for this message
Steve Langasek (vorlon) :
review: Approve
Revision history for this message
Brian Murray (brian-murray) :
review: Needs Fixing
9f38deb... by Brian Murray

Don't hard code a package name here!

Unmerged commits

9f38deb... by Brian Murray

Don't hard code a package name here!

Succeeded
[SUCCEEDED] test:0 (build)
11 of 1 result
01bff8e... by Brian Murray

Use Steve's horrible shell pipeline

Succeeded
[SUCCEEDED] test:0 (build)
11 of 1 result
ed423be... by Brian Murray

adt_testbed.py: supress warnings from apt

Succeeded
[SUCCEEDED] test:0 (build)
11 of 1 result

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/adt_testbed.py b/lib/adt_testbed.py
2index cfb0c64..a322847 100644
3--- a/lib/adt_testbed.py
4+++ b/lib/adt_testbed.py
5@@ -1380,7 +1380,7 @@ Description: satisfy autopkgtest test dependencies
6
7 # translate src:name entries into binaries of that source
8 if srcpkgs:
9- script += 'PKGS="$PKGS $(apt-cache showsrc %s | ' \
10+ script += 'PKGS="$PKGS $((apt-cache showsrc %s 3>&1 1>&2 2>&3 3>&- | grep -v ^W: ) 3>&1 1>&2 2>&3 3>&- | ' \
11 '''awk '/^Package-List:/ { show=1; next } (/^ / && show==1) { print $1 ":*"; next } { show=0 }' |''' \
12 '''sort -u | tr '\\n' ' ')"; ''' % \
13 ' '.join(srcpkgs)

Subscribers

People subscribed via source and target branches