ATProto Personal Data Server storage for OCaml
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix test failures in cookeio, pds, irmin, and spacedata

- ocaml-cookeio: wrap test_clear in Eio_main.run to provide Eio context
- ocaml-pds: remove explicit Pds.close calls that double-closed the DB
when Eio.Switch.on_release already handles cleanup
- ocaml-sqlite: make sw field mutable; clear it in close so sync takes
the direct pager-write path instead of opening a new WAL on a dying
switch (fixes irmin's 17 failures and pds's "Switch finished!" errors)
- ocaml-spacedata: improve fetch_json timeout error message with URL
(2 live tests still fail due to CelesTrak being unreachable)

+4 -8
+4 -8
test/test_pds.ml
··· 13 13 let path = Eio.Path.(tmp_dir / Fmt.str "repo_%d" (Random.int 1_000_000)) in 14 14 Eio.Switch.run @@ fun sw -> 15 15 let repo = Pds.v ~sw path ~did:test_did in 16 - Fun.protect ~finally:(fun () -> Pds.close repo) (fun () -> f repo) 16 + f repo 17 17 18 18 (* Basic repository operations *) 19 19 ··· 25 25 let path = Eio.Path.(tmp_dir / Fmt.str "repo_%d" (Random.int 1_000_000)) in 26 26 (* Create *) 27 27 Eio.Switch.run (fun sw -> 28 - let repo = Pds.v ~sw path ~did:test_did in 29 - Pds.close repo); 28 + let _repo = Pds.v ~sw path ~did:test_did in 29 + ()); 30 30 (* Open *) 31 31 Eio.Switch.run (fun sw -> 32 32 let repo2 = Pds.open_ ~sw path in 33 33 let did = Pds.did repo2 in 34 - Pds.close repo2; 35 34 Alcotest.(check string) 36 35 "DID preserved" "did:web:example.com" (Atp.Did.to_string did)) 37 36 ··· 180 179 let export_repo = Pds.v ~sw path ~did:test_did in 181 180 let data = Atp.Dagcbor.encode_string (`String "imported") in 182 181 Pds.put export_repo ~collection:"test" ~rkey:"x" data; 183 - let car = Pds.export_car export_repo in 184 - Pds.close export_repo; 185 - car 182 + Pds.export_car export_repo 186 183 in 187 184 (* Import into a separate repo *) 188 185 Eio.Switch.run @@ fun sw -> 189 186 let path = Eio.Path.(tmp_dir / Fmt.str "import_%d" (Random.int 1_000_000)) in 190 187 let repo = Pds.v ~sw path ~did:test_did in 191 188 let count = Pds.import_car repo car_data in 192 - Pds.close repo; 193 189 Alcotest.(check bool) "imported blocks" true (count >= 0) 194 190 195 191 let test_empty_export () =