File tree Expand file tree Collapse file tree 2 files changed +35
-7
lines changed
tmt/tests/booted/readonly Expand file tree Collapse file tree 2 files changed +35
-7
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,9 @@ impl SysrootLock {
3737 /// immediately, a status message will be printed to standard output.
3838 /// The lock will be unlocked when this object is dropped.
3939 pub async fn new_from_sysroot ( sysroot : & ostree:: Sysroot ) -> Result < Self > {
40- if sysroot. try_lock ( ) ? {
41- return Ok ( Self {
42- sysroot : sysroot. clone ( ) ,
43- unowned : false ,
44- } ) ;
45- }
46- async_task_with_spinner ( "Waiting for sysroot lock..." , sysroot. lock_future ( ) ) . await ?;
40+ let sysroot_clone = sysroot. clone ( ) ;
41+ let locker = tokio:: task:: spawn_blocking ( move || sysroot_clone. lock ( ) ) ;
42+ async_task_with_spinner ( "Waiting for sysroot lock..." , locker) . await ??;
4743 Ok ( Self {
4844 sysroot : sysroot. clone ( ) ,
4945 unowned : false ,
Original file line number Diff line number Diff line change 1+ # Verify we can spawn multiple bootc status at the same time
2+ use std assert
3+ use tap .nu
4+
5+ tap begin " concurrent bootc status"
6+
7+ # Fork via systemd-run
8+ let n = 10
9+ 0 .. $n | each { |v |
10+ # Clean up prior runs
11+ systemctl stop $" bootc-status-($v )" | complete
12+ }
13+ # Fork off a concurrent bootc status
14+ 0 .. $n | each { |v |
15+ systemd-run -- no-block - qr - u $" bootc-status-($v )" bootc status
16+ }
17+
18+ # Await completion
19+ 0 .. $n | each { |v |
20+ loop {
21+ let r = systemctl is-active $" bootc-status-($v )" | complete
22+ if $r.exit_code == 0 {
23+ break
24+ }
25+ # check status
26+ systemctl status $" bootc-status-($v )" out> /dev/null
27+ # Clean it up
28+ systemctl reset-failed $" bootc-status-($v )"
29+ }
30+ }
31+
32+ tap ok
You can’t perform that action at this time.
0 commit comments