Skip to content

Commit

Permalink
[Skymeld] Fix BazelBuildEventServiceModuleTest.
Browse files Browse the repository at this point in the history
The test was failing because of a mismatch in configuration. The right one, in
the context of this test, is determined from the list of analyzed target. With
Skymeld, the first action execution may happen before any analysis is done (via
the workspace status action). If we OOM at the first action execution, then
it's likely that there's no analysis info available with Skymeld.

This CL fixes that by only OOM-ing at the first shareable action, which makes it
certain that some analysis should have already been done.

PiperOrigin-RevId: 530878137
Change-Id: Ic85e0f1f4d9b8e74abe1701869b136f6767d978d
  • Loading branch information
joeleba authored and copybara-github committed May 10, 2023
1 parent a94383f commit 6945edd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,13 @@ private void testOom(Runnable throwOom) throws Exception {
.getEvaluator()
.injectGraphTransformerForTesting(
NotifyingHelper.makeNotifyingTransformer(
// To get the right configuration, some analysis has to already been done.
// We're only throwing OOM here for non shareable ActionLookupData to exclude
// workspace status actions, which in Skymeld mode can run without any analysis.
(key, type, order, context) -> {
if (key instanceof ActionLookupData && !threwOom.getAndSet(true)) {
if (key instanceof ActionLookupData
&& key.valueIsShareable()
&& !threwOom.getAndSet(true)) {
throwOom.run();
}
}));
Expand Down

0 comments on commit 6945edd

Please sign in to comment.