From 6945edd068cfa3bb566b5e0fb8715821ccfe39ad Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 10 May 2023 05:06:02 -0700 Subject: [PATCH] [Skymeld] Fix BazelBuildEventServiceModuleTest. 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 --- .../BazelBuildEventServiceModuleTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/google/devtools/build/lib/buildeventservice/BazelBuildEventServiceModuleTest.java b/src/test/java/com/google/devtools/build/lib/buildeventservice/BazelBuildEventServiceModuleTest.java index 1699e12e6ad230..c34ff7469994fc 100644 --- a/src/test/java/com/google/devtools/build/lib/buildeventservice/BazelBuildEventServiceModuleTest.java +++ b/src/test/java/com/google/devtools/build/lib/buildeventservice/BazelBuildEventServiceModuleTest.java @@ -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(); } }));