Test uc20-create-partitions-reinstall is flaky

Bug #1957930 reported by Ian Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Medium
Unassigned

Bug Description

Sometimes the spread test google:ubuntu-20.04-64:tests/main/uc20-create-partitions-reinstall will just somehow cause the network connection to be broken as shown in this output:

Error: 2022-01-13 16:22:50 Error executing google:ubuntu-20.04-64:tests/main/uc20-create-partitions-reinstall (jan131549-736676) :
-----
++ cat loop.txt
+ LOOP=/dev/loop2
+ grep ID_FS_TYPE
+ udevadm info --query=property /dev/loop2p2
ID_FS_TYPE=vfat
+ echo 'Run the snap-bootstrap tool in auto-detect mode'
Run the snap-bootstrap tool in auto-detect mode
+ go get ../../lib/uc20-create-partitions
go: finding github.com/canonical/go-tpm2 v0.0.0-20210827151749-f80ff5afff61
go: finding github.com/mvo5/goconfigparser v0.0.0-20200803085309-72e476556adb
go: finding github.com/snapcore/secboot v0.0.0-20211018143212-802bb19ca263
go: finding github.com/canonical/go-sp800.108-kdf v0.0.0-20210314145419-a3359f2d21b9
go: finding github.com/canonical/go-efilib v0.0.0-20210909101908-41435fa545d4
go: finding github.com/canonical/go-sp800.90a-drbg v0.0.0-20210314144037-6eeb1040d6c3
go: finding github.com/canonical/tcglog-parser v0.0.0-20210824131805-69fa1e9f0ad2
go: finding go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1
go: finding maze.io/x/crypto v0.0.0-20190131090603-9b94c9afe066
+ kerneldir=
+ uc20-create-partitions ./gadget-dir ''
install.go:76: installing a new system
install.go:77: gadget data from: ./gadget-dir
install.go:78: encryption:
partition.go:52: DEBUG: create partitions on /dev/loop2: /dev/loop2p3 : start= 2461696, size= 1536000, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="ubuntu-boot"
/dev/loop2p4 : start= 3997696, size= 32768, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="ubuntu-save"
/dev/loop2p5 : start= 4030464, size= 35032003, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="ubuntu-data"
install.go:158: created new partition /dev/loop2p3 for structure #3 ("ubuntu-boot") (size 750 MiB) role system-boot
content.go:47: DEBUG: create ext4 filesystem on /dev/loop2p3 with label "ubuntu-boot"
install.go:158: created new partition /dev/loop2p4 for structure #4 ("ubuntu-save") (size 16 MiB) role system-save
content.go:47: DEBUG: create ext4 filesystem on /dev/loop2p4 with label "ubuntu-save"
install.go:158: created new partition /dev/loop2p5 for structure #5 ("ubuntu-data") (size 16.70 GiB) role system-data
content.go:47: DEBUG: create ext4 filesystem on /dev/loop2p5 with label "ubuntu-data"
+ echo 'And check that the partitions are created'
And check that the partitions are created
+ MATCH '750M Linux filesystem'
+ sfdisk -l /dev/loop2
+ MATCH '16\.7G Linux filesystem'
+ sfdisk -l /dev/loop2
+ MATCH 'ext4 filesystem data,.* volume name "ubuntu-boot"'
+ file -s /dev/loop2p3
+ MATCH 'ext4 filesystem data,.* volume name "ubuntu-save"'
+ file -s /dev/loop2p4
+ MATCH 'ext4 filesystem data,.* volume name "ubuntu-data"'
+ file -s /dev/loop2p5
+ echo 'Create canary files on the ubuntu-{seed,boot,data} partitions'
Create canary files on the ubuntu-{seed,boot,data} partitions
+ mkdir ./ubuntu-seed ./ubuntu-boot ./ubuntu-save ./ubuntu-data
+ mount /dev/loop2p2 ./ubuntu-seed
+ mount /dev/loop2p3 ./ubuntu-boot
+ mount /dev/loop2p4 ./ubuntu-save
+ mount /dev/loop2p5 ./ubuntu-data
+ for label in ubuntu-seed ubuntu-boot ubuntu-save ubuntu-data
+ echo ubuntu-seed
+ umount ./ubuntu-seed
+ for label in ubuntu-seed ubuntu-boot ubuntu-save ubuntu-data
+ echo ubuntu-boot
+ umount ./ubuntu-boot
+ for label in ubuntu-seed ubuntu-boot ubuntu-save ubuntu-data
+ echo ubuntu-save
+ umount ./ubuntu-save
+ for label in ubuntu-seed ubuntu-boot ubuntu-save ubuntu-data
+ echo ubuntu-data
+ umount ./ubuntu-data
+ echo 'Run the snap-bootstrap again'
Run the snap-bootstrap again
+ uc20-create-partitions ./gadget-dir ''
install.go:76: installing a new system
install.go:77: gadget data from: ./gadget-dir
install.go:78: encryption:
partition.go:193: partition /dev/loop2p3 was created during previous install
partition.go:193: partition /dev/loop2p4 was created during previous install
partition.go:193: partition /dev/loop2p5 was created during previous install
partition.go:203: DEBUG: delete disk partitions [3 4 5]
-----
.
2022-01-13 16:22:50 Error debugging google:ubuntu-20.04-64:tests/main/uc20-create-partitions-reinstall (jan131549-736676) : read tcp 10.31.189.74:35200->35.231.173.91:22: read: connection reset by peer
2022-01-13 16:22:50 Discarding google:ubuntu-20.04-64 (jan131549-736676)...

The output from running uc20-create-partitions here is expected and correct, so it's very unexpected why this causes the connection to be reset and thus lose the spread run.

Tags: flaky-tests
summary: - test is flaky
+ Test uc20-create-partitions-reinstall is flaky
Revision history for this message
Ian Johnson (anonymouse67) wrote :

Ran the test against 228aa864f305bf6c89d1543b96dc00befe260861 about 20 times and couldn't reproduce

Revision history for this message
Ian Johnson (anonymouse67) wrote (last edit ):

Unfortunately didn't manage to get anywhere on this

Changed in snapd:
assignee: Ian Johnson (anonymouse67) → nobody
Changed in snapd:
status: New → Fix Released
importance: Undecided → Medium
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.