(root: &Path)
| 21 | } |
| 22 | |
| 23 | fn probe(root: &Path) -> String { |
| 24 | let readonly = match Repository::open_readonly_wait(root, Duration::ZERO) { |
| 25 | Ok(_) => "readonly-ok".to_string(), |
| 26 | Err(RepositoryError::DatabaseBusy) => "readonly-busy".to_string(), |
| 27 | Err(e) => format!("readonly-other: {e}"), |
| 28 | }; |
| 29 | let readwrite = match Repository::open_existing_wait(root, Duration::ZERO) { |
| 30 | Ok(_) => "readwrite-ok".to_string(), |
| 31 | Err(RepositoryError::DatabaseBusy) => "readwrite-busy".to_string(), |
| 32 | Err(e) => format!("readwrite-other: {e}"), |
| 33 | }; |
| 34 | // The journal opens native redb against the same database the repository |
| 35 | // opens through SnapshotBackend. Neither may bypass the other's lock. |
| 36 | let journal = match RedbChangeStore::open_existing(root.join(".atomic/atomic.redb")) { |
| 37 | Ok(_) => "journal-ok".to_string(), |
| 38 | Err(RedbStoreError::Database(e)) |
| 39 | if matches!(*e, redb::DatabaseError::DatabaseAlreadyOpen) => |
| 40 | { |
| 41 | "journal-busy".to_string() |
| 42 | } |
| 43 | Err(e) => format!("journal-other: {e}"), |
| 44 | }; |
| 45 | format!("{readonly} {readwrite} {journal}") |
| 46 | } |
| 47 | |
| 48 | fn child_probe(root: &Path, report_path: &Path) -> String { |
| 49 | let mut child = Command::new(std::env::current_exe().expect("test binary path")) |
no outgoing calls
no test coverage detected