Skip to content

Commit a1c471c

Browse files
committed
Fix CI flakes: mtime sleep, windows file IRIs, skip locked files
1 parent a5778a8 commit a1c471c

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

cli/tests/cli_integration.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ fn update_from_nested_subdir_uses_root_locations() {
135135
let ont_path = ont_dir.join("A.ttl");
136136
write_ttl(&ont_path, "http://example.org/ont/A", "");
137137

138+
// Ensure file mtime changes on rewrites (Linux FS timestamp granularity can be 1s)
139+
std::thread::sleep(std::time::Duration::from_millis(1100));
140+
138141
let out = Command::new(&exe)
139142
.current_dir(&root)
140143
.arg("init")

lib/tests/test_ontoenv.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,18 @@ fn import_graph_handles_cycles() -> Result<()> {
242242
let cfg = default_config(&dir);
243243
let mut env = OntoEnv::init(cfg, false)?;
244244
env.add(
245-
OntologyLocation::File(a_path),
245+
OntologyLocation::File(a_path.clone()),
246246
Overwrite::Allow,
247247
RefreshStrategy::UseCache,
248248
)?;
249249
env.add(
250-
OntologyLocation::File(b_path),
250+
OntologyLocation::File(b_path.clone()),
251251
Overwrite::Allow,
252252
RefreshStrategy::UseCache,
253253
)?;
254254

255255
let a_id = env
256-
.resolve(ResolveTarget::Location(OntologyLocation::from_str(&a_iri)?))
256+
.resolve(ResolveTarget::Location(OntologyLocation::File(a_path)))
257257
.unwrap();
258258
let merged = env.import_graph(&a_id, -1)?;
259259

@@ -336,23 +336,23 @@ fn import_graph_respects_recursion_depth() -> Result<()> {
336336
let cfg = default_config(&dir);
337337
let mut env = OntoEnv::init(cfg, false)?;
338338
env.add(
339-
OntologyLocation::File(a_path),
339+
OntologyLocation::File(a_path.clone()),
340340
Overwrite::Allow,
341341
RefreshStrategy::UseCache,
342342
)?;
343343
env.add(
344-
OntologyLocation::File(b_path),
344+
OntologyLocation::File(b_path.clone()),
345345
Overwrite::Allow,
346346
RefreshStrategy::UseCache,
347347
)?;
348348
env.add(
349-
OntologyLocation::File(c_path),
349+
OntologyLocation::File(c_path.clone()),
350350
Overwrite::Allow,
351351
RefreshStrategy::UseCache,
352352
)?;
353353

354354
let a_id = env
355-
.resolve(ResolveTarget::Location(OntologyLocation::from_str(&a_iri)?))
355+
.resolve(ResolveTarget::Location(OntologyLocation::File(a_path)))
356356
.unwrap();
357357

358358
// depth 0: only A (no imports attached)

0 commit comments

Comments
 (0)