Skip to content

Commit 5d0e5a7

Browse files
justinhorvitzcopybara-github
authored andcommitted
Reinstate previous behavior of notifying the graph listener of GET_BATCH for every DEP_REQUESTED call.
Recent optimizations in 62d1b0b and 243c2b7 mean that deps can now be requested via `get()` instead of `getBatch()`. It is possible that existing regression tests are no longer WAI because they are not getting the `GET_BATCH` event (i.e. they are passing but not testing what they intend to). Restoring the previous behavior is much easier than hunting down every test that is affected. PiperOrigin-RevId: 479416036 Change-Id: Iea3ac0a2ad02313dc8e61084fa5f585763a5967f
1 parent 40dc549 commit 5d0e5a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/java/com/google/devtools/build/skyframe/NotifyingHelper.java

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ static class NotifyingProcessableGraph implements ProcessableGraph {
8080
@Override
8181
public NodeEntry get(@Nullable SkyKey requestor, Reason reason, SkyKey key)
8282
throws InterruptedException {
83+
// Maintains behavior for tests written when all DEP_REQUESTED calls were made as batch
84+
// requests. Now there are optimizations in SkyFunctionEnvironment for looking up deps
85+
// individually, but older tests may be written to listen for a GET_BATCH event.
86+
if (reason == Reason.DEP_REQUESTED) {
87+
notifyingHelper.graphListener.accept(key, EventType.GET_BATCH, Order.BEFORE, reason);
88+
}
8389
return notifyingHelper.wrapEntry(key, delegate.get(requestor, reason, key));
8490
}
8591

0 commit comments

Comments
 (0)