aep export: note what the concurrency test covers and why a failed template build is not kept (#3277)

This commit is contained in:
vangel76 committed 2026-11-08 03:26:16 +01:00
1 parent a18e3ce336
commit cdb81c06ec
2 files changed
+5 -2

No files matched your search

+4 -2
View File
@@ -930,8 +930,10 @@ mod tests {
}
}
/// Exports running at the same time on several threads, the first of them possibly building
/// the shared template, all give the single-threaded bytes.
/// Exports running at the same time on several threads all give the single-threaded bytes.
/// This checks concurrent exports from a template that is already built: other tests in this
/// binary usually fill the shared template first, so the race on the first build is not
/// reliably exercised here (the `static OnceLock` makes that race safe by construction).
#[test]
fn concurrent_exports_give_the_same_bytes() {
let plans: Vec<ProjectPlan> = ["", " x", " y", " z"].iter().map(|t| plan_of(&varied(t))).collect();
+1
View File
@@ -94,6 +94,7 @@ pub(crate) fn shared() -> R<&'static Template> {
if let Some(t) = SHARED.get() {
return Ok(t);
}
// A failed build returns here, before `get_or_init`, so it is never kept.
let t = Template::load()?;
Ok(SHARED.get_or_init(|| t))
}