rust-loopdev in mantic has been failing[1] on arm64. Here is one example[2]:
864s ---- detach_a_backing_file_default stdout ----
864s thread 'detach_a_backing_file_default' panicked at 'assertion failed: `(left == right)`
864s left: `0`,
864s right: `1`: there should be no loopback devices mounted', tests/integration_test.rs:176:5
That test looks pretty simple. It counts how many loop devices are at the start, attached a backing file, checks, detached, and counts the number of attached loop devices at the end. Both counts should be equal.
But, according to the test failure, they are not.
I patched the function the test uses with some println() debug statements, and it looks like this:
println!("XXX end list_device(None): {:?}, num_devices_at_start={}", list_device(None), num_devices_at_start);
assert_eq!( list_device(None).len(), num_devices_at_start,
"there should be no loopback devices mounted"
);
detach_all();
}
Something is changing the list_device(None) output under our feet, as the test runs. The test starts with 4, and right after "let _lock = setup();", it's 3. This doesn't happen always.
rust-loopdev in mantic has been failing[1] on arm64. Here is one example[2]:
864s ---- detach_ a_backing_ file_default stdout ---- a_backing_ file_default' panicked at 'assertion failed: `(left == right)` on_test. rs:176: 5
864s thread 'detach_
864s left: `0`,
864s right: `1`: there should be no loopback devices mounted', tests/integrati
That test looks pretty simple. It counts how many loop devices are at the start, attached a backing file, checks, detached, and counts the number of attached loop devices at the end. Both counts should be equal.
But, according to the test failure, they are not.
I patched the function the test uses with some println() debug statements, and it looks like this:
fn detach_ a_backing_ file(offset: u64, sizelimit: u64, file_size: i64) { at_start = list_device( None).len( ); at_start= {}",num_ devices_ at_start) ; None).len( )={}", list_device( None).len( ));
let num_devices_
println!("XXX num_devices_
println!("XXX list_device(
let _lock = setup();
println!("XXX start list_device(None): {:?}, len={}, var={}", list_device(None), list_device( None).len( ), num_devices_ at_start) ; backing_ file(file_ size);
attach_ file(
"/ dev/loop3" ,
file. to_path_ buf().to_ str().unwrap( ),
sizelimit,
{
let file = create_
offset,
);
let ld0 = LoopDevice: :open(" /dev/loop3" )
.expect( "should be able to open the created loopback device");
};
std: :thread: :sleep( std::time: :Duration: :from_millis( 500));
println!("XXX end list_device(None): {:?}, num_devices_ at_start= {}", list_device(None), num_devices_ at_start) ;
list_device( None).len( ),
num_devices_ at_start,
assert_eq!(
"there should be no loopback devices mounted"
);
detach_all();
}
And, when it fails, this is the output: a_backing_ file_with_ offset stdout ---- at_start= 4 None).len( )=4 var/lib/ snapd/snaps/ lxd_25116. snap") }, LoopDeviceOutput { name: "/dev/loop2", size_limit: Some(0), offset: Some(0), back_file: Some("/ var/lib/ snapd/snaps/ snapd_19459. snap") }, LoopDeviceOutput { name: "/dev/loop0", size_limit: Some(0), offset: Some(0), back_file: Some("/ var/lib/ snapd/snaps/ core22_ 821.snap" ) }], len=3, var=4 var/lib/ snapd/snaps/ lxd_25116. snap") }, LoopDeviceOutput { name: "/dev/loop2", size_limit: Some(0), offset: Some(0), back_file: Some("/ var/lib/ snapd/snaps/ snapd_19459. snap") }, LoopDeviceOutput { name: "/dev/loop0", size_limit: Some(0), offset: Some(0), back_file: Some("/ var/lib/ snapd/snaps/ core22_ 821.snap" ) }], num_devices_ at_start= 4 a_backing_ file_with_ offset' panicked at 'assertion failed: `(left == right)` on_test. rs:180: 5
---- detach_
XXX num_devices_
XXX list_device(
XXX start list_device(None): [LoopDeviceOutput { name: "/dev/loop1", size_limit: Some(0), offset: Some(0), back_file: Some("/
XXX end list_device(None): [LoopDeviceOutput { name: "/dev/loop1", size_limit: Some(0), offset: Some(0), back_file: Some("/
thread 'detach_
left: `3`,
right: `4`: there should be no loopback devices mounted', tests/integrati
Something is changing the list_device(None) output under our feet, as the test runs. The test starts with 4, and right after "let _lock = setup();", it's 3. This doesn't happen always.
1. https:/ /autopkgtest. ubuntu. com/packages/ r/rust- loopdev/ mantic/ arm64 /autopkgtest. ubuntu. com/results/ autopkgtest- mantic/ mantic/ arm64/r/ rust-loopdev/ 20230814_ 100137_ 214a4@/ log.gz
2. https:/