autopkgtest: Specifying --apt-pocket causes wrong unwanted pinning to default release

Bug #2009191 reported by Paride Legovini
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autopkgtest (Debian)
Fix Released
Unknown
autopkgtest (Ubuntu)
Fix Released
Undecided
Paride Legovini
Mantic
Incomplete
Undecided
Unassigned

Bug Description

Imported from Debian bug http://bugs.debian.org/1032314:

Package: autopkgtest
Severity: normal
X-Debbugs-Cc: <email address hidden>

Adding a pocket via --apt-pocket=<POCKET> causes the
_get_default_release() function to be called. This is needed to
construct the sources.list entry for the pocket, which will be in the
form of:

  deb <mirror> <default_release>-<POCKET> ...

The _get_default_release() function caches the detected default
release in the default_release variable, which is the same variable
used to store the --apt-default-release=<RELEASE> value. This has
no effect when only one test is present in d/t/control, but when
more than one test is present the tests after the first will have
unwanted/wrong pinning (as if --apt-default-release was specified).

Related branches

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

The ingredients required to hit this bug are:

1. an all-proposed build (--apt-pocket=proposed with no package pinning)
2. multiple tests defined in d/t/control
3. the tests do not allow reusing the same testbed system

Condition 1. means that we don't hit the bug in tests runs triggered
by britney, as those are not all-proposed.

Changed in autopkgtest (Ubuntu):
assignee: nobody → Paride Legovini (paride)
status: New → In Progress
Changed in autopkgtest (Debian):
importance: Undecided → Unknown
status: New → Fix Committed
Revision history for this message
Paride Legovini (paride) wrote :

This is now Fix Released in Ubuntu.

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

autopkgtest (5.28ubuntu1) lunar; urgency=medium

  [ Paride Legovini ]
  * cross-arch testing
  * Prevent --apt-pocket from setting the wrong default release

 -- Heather Ellsworth <email address hidden> Tue, 14 Mar 2023 16:04:39 -0600

Changed in autopkgtest (Ubuntu):
status: In Progress → Fix Released
Changed in autopkgtest (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Paul Gevers (paul-climbing) wrote (last edit ):

@Paride: I like to come back to this issue, because I'm working on some changes in the same function and I'm not getting why this was an issue in the first place. Do you recall why the function wasn't idem-potent as intended? Looking at the patch (the test code) I have an idea, but that would mean that the function misbehaves in the first test anyways.

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

Hi Paul, I think I remember. The function itself is idempotent, the issue is that by storing (caching) the guessed default release in self.default_release, this `if` will be affected, and change the pinning:

https://salsa.debian.org/ci-team/autopkgtest/-/blob/b4fb54e2a44bbf375d23e34837f377a402c981b2/lib/adt_testbed.py#L401

This only happens at the second test (and later tests), because while running the very first test _get_default_release() was never executed yet, so self.default_release is None and the code under the `if` I pointed to doesn't execute.

Revision history for this message
Paul Gevers (paul-climbing) wrote :

Thanks. I think that was the missing piece for me. After some checking, the solution now also makes sense.

Maybe we could have fixed that `if` instead (or maybe *also*). As the comment above it said, I wasn't sure if that `if` even was useful. But let's leave it as it is now.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Please provide an clear Test Case and describe the possible Regression Potential for this bug in the bug description [1]. I see a possible test case in comment #1, but I'd like it to be made clear that this is what is expected to be performed to verify the upload.

[1] https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Changed in autopkgtest (Ubuntu Mantic):
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.