From 1a6455fe1ecf339aea2c0f011631f0394a4a72b2 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Wed, 17 Jan 2024 13:51:26 -0500 Subject: [PATCH] Fix CI --- tests/tests.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/tests.rs b/tests/tests.rs index 8c66043..ed68b66 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -49,7 +49,12 @@ impl ExpectedText<'_> { let file_path = if filename.ends_with(".pdf.link") { let docs_cache = "tests/docs_cache"; if !std::path::Path::new(docs_cache).exists() { - std::fs::create_dir(docs_cache).unwrap(); + // This might race with exists test above, but that's fine + if let Err(e) = std::fs::create_dir(docs_cache) { + if e.kind() != std::io::ErrorKind::AlreadyExists { + panic!("Failed to create directory {}, {}", docs_cache, e); + } + } } let file_path = format!("{}/{}", docs_cache, filename.replace(".link", "")); if std::path::Path::new(&file_path).exists() {