Skip to content

Commit

Permalink
CI: Reduce parallelism of render tests on macOS in CI only.
Browse files Browse the repository at this point in the history
We've been getting frequent GPU out-of-memory errors, and I suspect
they're due to a memory leak but it might be just limited resources.
So, let's see what this does.
  • Loading branch information
kpreid committed Jan 1, 2024
1 parent 75b7f5b commit 2a879c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test-renderers/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ pub async fn harness_main<Factory, Ff>(
renderer_id: RendererId,
test_suite: fn(&mut TestCaseCollector<'_>),
factory_factory: Ff, // TODO: better name
max_parallelism: Option<usize>,
) -> HarnessResult
where
Factory: RendererFactory + 'static,
Expand Down Expand Up @@ -335,7 +336,7 @@ where
}
.boxed()
})
.buffer_unordered(4);
.buffer_unordered(max_parallelism.unwrap_or(4));

let mut per_test_output = BTreeMap::new();
let mut count_passed = 0;
Expand Down
1 change: 1 addition & 0 deletions test-renderers/tests/ray-render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async fn main() -> test_renderers::HarnessResult {
RendererId::Raytracer,
test_renderers::test_cases::all_tests,
|| std::future::ready(RtFactory),
None,
)
.await
}
Expand Down
9 changes: 9 additions & 0 deletions test-renderers/tests/wgpu-render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,20 @@ async fn main() -> test_renderers::HarnessResult {
return ExitCode::SUCCESS;
};

let parallelism = if option_env!("CI").is_some() && cfg!(target_os = "macos") {
// Attempted workaround for out-of-memory on macOS CI. If this doesn't help then
// the problem must be a leak, not concurrency.
Some(1)
} else {
None
};

test_renderers::harness_main(
test_renderers::HarnessArgs::parse(),
RendererId::Wgpu,
test_renderers::test_cases::all_tests,
get_factory,
parallelism,
)
.await
}
Expand Down

0 comments on commit 2a879c6

Please sign in to comment.