Remove Executor.getEventHandler

The only use in production code was SkyframeActionExecutor, which also
has access to the Reporter, which is always the same reference.

Also remove some unused code in BlazeExecutor.

PiperOrigin-RevId: 242110713
diff --git a/src/main/java/com/google/devtools/build/lib/actions/Executor.java b/src/main/java/com/google/devtools/build/lib/actions/Executor.java
index 2db18bd..a1e0400 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/Executor.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/Executor.java
@@ -16,7 +16,6 @@
 import com.google.common.eventbus.EventBus;
 import com.google.devtools.build.lib.actions.ActionExecutionContext.ShowSubcommands;
 import com.google.devtools.build.lib.clock.Clock;
-import com.google.devtools.build.lib.events.ExtendedEventHandler;
 import com.google.devtools.build.lib.vfs.FileSystem;
 import com.google.devtools.build.lib.vfs.Path;
 import com.google.devtools.common.options.OptionsProvider;
@@ -78,12 +77,6 @@
   ShowSubcommands reportsSubcommands();
 
   /**
-   * An event listener to report messages to. Errors that signal a action failure should use
-   * ActionExecutionException.
-   */
-  ExtendedEventHandler getEventHandler();
-
-  /**
    * Looks up and returns an action context implementation of the given interface type.
    */
   <T extends ActionContext> T getContext(Class<? extends T> type);
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
index f5324f9..0316105 100644
--- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
+++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
@@ -333,7 +333,6 @@
                           analysisResult, aspects)));
         }
       }
-      executor.executionPhaseStarting();
       skyframeExecutor.drainChangedFiles();
 
       if (request.getViewOptions().discardAnalysisCache
@@ -400,8 +399,6 @@
         getReporter().handle(Event.progress("Building complete."));
       }
 
-      executor.executionPhaseEnding();
-
       if (buildCompleted) {
         saveActionCache(actionCache);
       }
diff --git a/src/main/java/com/google/devtools/build/lib/exec/BlazeExecutor.java b/src/main/java/com/google/devtools/build/lib/exec/BlazeExecutor.java
index 74c9e75..c7637e7 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/BlazeExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/BlazeExecutor.java
@@ -13,7 +13,6 @@
 // limitations under the License.
 package com.google.devtools.build.lib.exec;
 
-import com.google.common.base.Preconditions;
 import com.google.common.eventbus.EventBus;
 import com.google.devtools.build.lib.actions.ActionContext;
 import com.google.devtools.build.lib.actions.ActionExecutionContext.ShowSubcommands;
@@ -21,13 +20,11 @@
 import com.google.devtools.build.lib.actions.ExecutorInitException;
 import com.google.devtools.build.lib.clock.Clock;
 import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
-import com.google.devtools.build.lib.events.ExtendedEventHandler;
 import com.google.devtools.build.lib.events.Reporter;
 import com.google.devtools.build.lib.vfs.FileSystem;
 import com.google.devtools.build.lib.vfs.Path;
 import com.google.devtools.common.options.OptionsProvider;
 import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * The Executor class provides a dynamic abstraction of the various actual primitive system
@@ -44,11 +41,9 @@
   private final ShowSubcommands showSubcommands;
   private final FileSystem fileSystem;
   private final Path execRoot;
-  private final Reporter reporter;
   private final EventBus eventBus;
   private final Clock clock;
   private final OptionsProvider options;
-  private AtomicBoolean inExecutionPhase;
 
   private final Map<Class<? extends ActionContext>, ActionContext> contextMap;
 
@@ -78,11 +73,9 @@
     this.showSubcommands = executionOptions.showSubcommands;
     this.fileSystem = fileSystem;
     this.execRoot = execRoot;
-    this.reporter = reporter;
     this.eventBus = eventBus;
     this.clock = clock;
     this.options = options;
-    this.inExecutionPhase = new AtomicBoolean(false);
     this.contextMap = spawnActionContextMaps.contextMap();
 
     if (executionOptions.debugPrintActionContexts) {
@@ -108,11 +101,6 @@
   }
 
   @Override
-  public ExtendedEventHandler getEventHandler() {
-    return reporter;
-  }
-
-  @Override
   public EventBus getEventBus() {
     return eventBus;
   }
@@ -127,25 +115,6 @@
     return showSubcommands;
   }
 
-  /**
-   * This method is called before the start of the execution phase of each
-   * build request.
-   */
-  public void executionPhaseStarting() {
-    Preconditions.checkState(!inExecutionPhase.getAndSet(true));
-  }
-
-  /**
-   * This method is called after the end of the execution phase of each build
-   * request (even if there was an interrupt).
-   */
-  public void executionPhaseEnding() {
-    if (!inExecutionPhase.get()) {
-      return;
-    }
-    inExecutionPhase.set(false);
-  }
-
   @Override
   public <T extends ActionContext> T getContext(Class<? extends T> type) {
     return type.cast(contextMap.get(type));
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
index 24cc839..02d3c1d 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
@@ -395,8 +395,7 @@
       OutputService outputService) {
     this.reporter = Preconditions.checkNotNull(reporter);
     this.executorEngine = Preconditions.checkNotNull(executor);
-    this.progressSuppressingEventHandler =
-        new ProgressSuppressingEventHandler(this.executorEngine.getEventHandler());
+    this.progressSuppressingEventHandler = new ProgressSuppressingEventHandler(reporter);
 
     // Start with a new map each build so there's no issue with internal resizing.
     this.buildActionMap = Maps.newConcurrentMap();
@@ -564,6 +563,12 @@
         env, actionLookupData, action, completionReceiver);
   }
 
+  private ExtendedEventHandler selectEventHandler(ProgressEventBehavior progressEventBehavior) {
+    return progressEventBehavior.equals(ProgressEventBehavior.EMIT)
+        ? reporter
+        : progressSuppressingEventHandler;
+  }
+
   /**
    * Returns an ActionExecutionContext suitable for executing a particular action. The caller should
    * pass the returned context to {@link #executeAction}, and any other method that needs to execute
@@ -587,9 +592,7 @@
         actionKeyContext,
         metadataHandler,
         fileOutErr,
-        progressEventBehavior.equals(ProgressEventBehavior.EMIT)
-            ? executorEngine.getEventHandler()
-            : progressSuppressingEventHandler,
+        selectEventHandler(progressEventBehavior),
         clientEnv,
         topLevelFilesets,
         new ArtifactExpanderImpl(expandedInputs, expandedFilesets),
@@ -633,9 +636,10 @@
       if (action instanceof NotifyOnActionCacheHit) {
         NotifyOnActionCacheHit notify = (NotifyOnActionCacheHit) action;
         ExtendedEventHandler contextEventHandler =
-            probeCompletedAndReset(action)
-                ? progressSuppressingEventHandler
-                : executorEngine.getEventHandler();
+            selectEventHandler(
+                probeCompletedAndReset(action)
+                    ? ProgressEventBehavior.SUPPRESS
+                    : ProgressEventBehavior.EMIT);
         ActionCachedContext context =
             new ActionCachedContext() {
               @Override
@@ -711,9 +715,7 @@
             actionLogBufferPathGenerator.generate(
                 ArtifactPathResolver.createPathResolver(
                     actionFileSystem, executorEngine.getExecRoot())),
-            progressEventBehavior.equals(ProgressEventBehavior.EMIT)
-                ? executorEngine.getEventHandler()
-                : progressSuppressingEventHandler,
+            selectEventHandler(progressEventBehavior),
             clientEnv,
             env,
             actionFileSystem);
diff --git a/src/test/java/com/google/devtools/build/lib/BUILD b/src/test/java/com/google/devtools/build/lib/BUILD
index a990099..6c10c22 100644
--- a/src/test/java/com/google/devtools/build/lib/BUILD
+++ b/src/test/java/com/google/devtools/build/lib/BUILD
@@ -744,6 +744,7 @@
         "//src/main/java/com/google/devtools/build/lib:bazel-main",
         "//src/main/java/com/google/devtools/build/lib:bazel-rules",
         "//src/main/java/com/google/devtools/build/lib:build-base",
+        "//src/main/java/com/google/devtools/build/lib:events",
         "//src/main/java/com/google/devtools/build/lib:io",
         "//src/main/java/com/google/devtools/build/lib:util",
         "//src/main/java/com/google/devtools/build/lib/actions",
diff --git a/src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java b/src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java
index 9fa6ae3..f724072 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java
@@ -63,7 +63,7 @@
         actionKeyContext,
         null,
         outErr,
-        executor.getEventHandler(),
+        /*eventHandler=*/ null,
         ImmutableMap.<String, String>of(),
         ImmutableMap.of(),
         null,
diff --git a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
index e50c611..6600f2a 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java
@@ -115,6 +115,7 @@
 
   public static ActionExecutionContext createContext(
       Executor executor,
+      ExtendedEventHandler eventHandler,
       ActionKeyContext actionKeyContext,
       FileOutErr fileOutErr,
       Path execRoot,
@@ -122,6 +123,7 @@
       @Nullable ActionGraph actionGraph) {
     return createContext(
         executor,
+        eventHandler,
         actionKeyContext,
         fileOutErr,
         execRoot,
@@ -132,6 +134,7 @@
 
   public static ActionExecutionContext createContext(
       Executor executor,
+      ExtendedEventHandler eventHandler,
       ActionKeyContext actionKeyContext,
       FileOutErr fileOutErr,
       Path execRoot,
@@ -145,7 +148,7 @@
         actionKeyContext,
         metadataHandler,
         fileOutErr,
-        executor != null ? executor.getEventHandler() : null,
+        eventHandler,
         ImmutableMap.copyOf(clientEnv),
         ImmutableMap.of(),
         actionGraph == null
@@ -156,7 +159,7 @@
   }
 
   public static ActionExecutionContext createContext(ExtendedEventHandler eventHandler) {
-    DummyExecutor dummyExecutor = new DummyExecutor(eventHandler);
+    DummyExecutor dummyExecutor = new DummyExecutor();
     return new ActionExecutionContext(
         dummyExecutor,
         null,
@@ -174,12 +177,12 @@
 
   public static ActionExecutionContext createContextForInputDiscovery(
       Executor executor,
+      ExtendedEventHandler eventHandler,
       ActionKeyContext actionKeyContext,
       FileOutErr fileOutErr,
       Path execRoot,
       MetadataHandler metadataHandler,
       BuildDriver buildDriver) {
-    ExtendedEventHandler eventHandler = executor != null ? executor.getEventHandler() : null;
     return ActionExecutionContext.forInputDiscovery(
         executor,
         new SingleBuildFileCache(execRoot.getPathString(), execRoot.getFileSystem()),
diff --git a/src/test/java/com/google/devtools/build/lib/actions/util/DummyExecutor.java b/src/test/java/com/google/devtools/build/lib/actions/util/DummyExecutor.java
index 298059c..3361864 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/util/DummyExecutor.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/util/DummyExecutor.java
@@ -19,7 +19,6 @@
 import com.google.devtools.build.lib.actions.Executor;
 import com.google.devtools.build.lib.clock.BlazeClock;
 import com.google.devtools.build.lib.clock.Clock;
-import com.google.devtools.build.lib.events.ExtendedEventHandler;
 import com.google.devtools.build.lib.vfs.FileSystem;
 import com.google.devtools.build.lib.vfs.Path;
 import com.google.devtools.common.options.OptionsProvider;
@@ -29,20 +28,14 @@
 
   private final FileSystem fileSystem;
   private final Path inputDir;
-  private final ExtendedEventHandler eventHandler;
 
   public DummyExecutor(FileSystem fileSystem, Path inputDir) {
-    this(fileSystem, inputDir, null);
-  }
-
-  public DummyExecutor(ExtendedEventHandler eventHandler) {
-    this(null, null, eventHandler);
-  }
-
-  public DummyExecutor(FileSystem fileSystem, Path inputDir, ExtendedEventHandler eventHandler) {
     this.fileSystem = fileSystem;
     this.inputDir = inputDir;
-    this.eventHandler = eventHandler;
+  }
+
+  public DummyExecutor() {
+    this(/*fileSystem=*/ null, /*inputDir=*/ null);
   }
 
   @Override
@@ -71,11 +64,6 @@
   }
 
   @Override
-  public ExtendedEventHandler getEventHandler() {
-    return eventHandler;
-  }
-
-  @Override
   public <T extends ActionContext> T getContext(Class<? extends T> type) {
     throw new UnsupportedOperationException();
   }
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTestCase.java
index 32f6fa1..e7b0992 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTestCase.java
@@ -28,6 +28,7 @@
 import com.google.devtools.build.lib.actions.Executor;
 import com.google.devtools.build.lib.analysis.util.ActionTester;
 import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
+import com.google.devtools.build.lib.events.StoredEventHandler;
 import com.google.devtools.build.lib.exec.BinTools;
 import com.google.devtools.build.lib.exec.util.TestExecutorBuilder;
 import com.google.devtools.build.lib.util.io.FileOutErr;
@@ -68,7 +69,7 @@
             actionKeyContext,
             null,
             new FileOutErr(),
-            executor.getEventHandler(),
+            new StoredEventHandler(),
             ImmutableMap.<String, String>of(),
             ImmutableMap.of(),
             null,
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.java
index 7625475..1bbcb9b 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.java
@@ -35,6 +35,7 @@
 import com.google.devtools.build.lib.actions.util.ActionsTestUtil;
 import com.google.devtools.build.lib.analysis.util.ActionTester;
 import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
+import com.google.devtools.build.lib.events.StoredEventHandler;
 import com.google.devtools.build.lib.exec.BinTools;
 import com.google.devtools.build.lib.exec.util.TestExecutorBuilder;
 import com.google.devtools.build.lib.util.io.FileOutErr;
@@ -200,7 +201,7 @@
         actionKeyContext,
         null,
         new FileOutErr(),
-        executor.getEventHandler(),
+        new StoredEventHandler(),
         ImmutableMap.<String, String>of(),
         ImmutableMap.of(),
         artifactExpander,
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkActionTest.java
index 2068150..37ac7d0 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkActionTest.java
@@ -23,6 +23,7 @@
 import com.google.devtools.build.lib.actions.Artifact;
 import com.google.devtools.build.lib.actions.Executor;
 import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
+import com.google.devtools.build.lib.events.StoredEventHandler;
 import com.google.devtools.build.lib.exec.util.TestExecutorBuilder;
 import com.google.devtools.build.lib.skyframe.serialization.testutils.SerializationDepsUtils;
 import com.google.devtools.build.lib.skyframe.serialization.testutils.SerializationTester;
@@ -86,7 +87,7 @@
                 actionKeyContext,
                 null,
                 null,
-                executor.getEventHandler(),
+                new StoredEventHandler(),
                 ImmutableMap.<String, String>of(),
                 ImmutableMap.of(),
                 null,
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java
index 3495ad1..e6a6ac5 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java
@@ -28,6 +28,7 @@
 import com.google.devtools.build.lib.actions.Executor;
 import com.google.devtools.build.lib.analysis.BlazeDirectories;
 import com.google.devtools.build.lib.analysis.ServerDirectories;
+import com.google.devtools.build.lib.events.StoredEventHandler;
 import com.google.devtools.build.lib.exec.BinTools;
 import com.google.devtools.build.lib.exec.util.TestExecutorBuilder;
 import com.google.devtools.build.lib.testutil.FoundationTestCase;
@@ -189,7 +190,7 @@
         actionKeyContext,
         null,
         new FileOutErr(),
-        executor.getEventHandler(),
+        new StoredEventHandler(),
         ImmutableMap.of(),
         ImmutableMap.of(),
         null,
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
index a8fcfc9..3b7c1a5 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
@@ -2212,7 +2212,7 @@
 
     public ActionExecutionContext build() {
       return new ActionExecutionContext(
-          new DummyExecutor(fileSystem, getExecRoot(), reporter),
+          new DummyExecutor(fileSystem, getExecRoot()),
           actionInputFileCache,
           /*actionInputPrefetcher=*/ null,
           actionKeyContext,
diff --git a/src/test/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategyTest.java b/src/test/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategyTest.java
index f58c04c..05c42df 100644
--- a/src/test/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategyTest.java
+++ b/src/test/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategyTest.java
@@ -244,7 +244,14 @@
             PathFragment.create("output.txt"), ArtifactRoot.asSourceRoot(Root.fromPath(testRoot)));
     outErr = new FileOutErr(testRoot.getRelative("stdout"), testRoot.getRelative("stderr"));
     actionExecutionContext =
-        ActionsTestUtil.createContext(null, actionKeyContext, outErr, testRoot, null, null);
+        ActionsTestUtil.createContext(
+            /*executor=*/ null,
+            /*eventHandler=*/ null,
+            actionKeyContext,
+            outErr,
+            testRoot,
+            /*metadataHandler=*/ null,
+            /*actionGraph=*/ null);
   }
 
   void createSpawnStrategy(int localDelay, int remoteDelay) throws ExecutorInitException {
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD b/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD
index fda9ab3..682aadf 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD
@@ -34,6 +34,7 @@
         "//src/main/java/com/google/devtools/build/lib:build-base",
         "//src/main/java/com/google/devtools/build/lib:core-rules",
         "//src/main/java/com/google/devtools/build/lib:core-workspace-rules",
+        "//src/main/java/com/google/devtools/build/lib:events",
         "//src/main/java/com/google/devtools/build/lib:io",
         "//src/main/java/com/google/devtools/build/lib:packages-internal",
         "//src/main/java/com/google/devtools/build/lib:skylark_semantics",
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CreateIncSymlinkActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CreateIncSymlinkActionTest.java
index 04768d3..7ed51c6 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CreateIncSymlinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CreateIncSymlinkActionTest.java
@@ -23,6 +23,7 @@
 import com.google.devtools.build.lib.actions.Artifact;
 import com.google.devtools.build.lib.actions.ArtifactRoot;
 import com.google.devtools.build.lib.actions.util.DummyExecutor;
+import com.google.devtools.build.lib.events.StoredEventHandler;
 import com.google.devtools.build.lib.testutil.FoundationTestCase;
 import com.google.devtools.build.lib.util.Fingerprint;
 import com.google.devtools.build.lib.vfs.FileSystemUtils;
@@ -117,17 +118,17 @@
     DummyExecutor executor = new DummyExecutor(fileSystem, rootDirectory);
     return new ActionExecutionContext(
         executor,
-        null,
-        null,
-        null,
-        null,
-        null,
-        executor.getEventHandler(),
-        ImmutableMap.of(),
-        ImmutableMap.of(),
-        null,
-        null,
-        null);
+        /*actionInputFileCache=*/ null,
+        /*actionInputPrefetcher=*/ null,
+        /*actionKeyContext=*/ null,
+        /*metadataHandler=*/ null,
+        /*fileOutErr=*/ null,
+        new StoredEventHandler(),
+        /*clientEnv=*/ ImmutableMap.of(),
+        /*topLevelFilesets=*/ ImmutableMap.of(),
+        /*artifactExpander=*/ null,
+        /*actionFileSystem=*/ null,
+        /*skyframeDepsResult=*/ null);
   }
 
   @Test
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTest.java
index eddcc43..f3e8b13 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTest.java
@@ -30,6 +30,7 @@
 import com.google.devtools.build.lib.analysis.util.ActionTester.ActionCombinationFactory;
 import com.google.devtools.build.lib.analysis.util.AnalysisTestUtil;
 import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
+import com.google.devtools.build.lib.events.StoredEventHandler;
 import com.google.devtools.build.lib.exec.BinTools;
 import com.google.devtools.build.lib.exec.util.TestExecutorBuilder;
 import com.google.devtools.build.lib.util.io.FileOutErr;
@@ -82,15 +83,15 @@
     context =
         new ActionExecutionContext(
             executor,
-            null,
+            /*actionInputFileCache=*/ null,
             ActionInputPrefetcher.NONE,
             actionKeyContext,
-            null,
+            /*metadataHandler=*/ null,
             new FileOutErr(),
-            executor.getEventHandler(),
-            ImmutableMap.<String, String>of(),
-            ImmutableMap.of(),
-            null,
+            new StoredEventHandler(),
+            /*clientEnv=*/ ImmutableMap.of(),
+            /*topLevelFilesets=*/ ImmutableMap.of(),
+            /*artifactExpander=*/ null,
             /*actionFileSystem=*/ null,
             /*skyframeDepsResult=*/ null);
   }
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
index bb7b762..ca08220 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
@@ -431,7 +431,7 @@
   protected void buildArtifacts(Builder builder, Artifact... artifacts)
       throws BuildFailedException, AbruptExitException, InterruptedException, TestExecException,
           OptionsParsingException {
-    buildArtifacts(builder, new DummyExecutor(fileSystem, rootDirectory, reporter), artifacts);
+    buildArtifacts(builder, new DummyExecutor(fileSystem, rootDirectory), artifacts);
   }
 
   protected void buildArtifacts(Builder builder, Executor executor, Artifact... artifacts)
diff --git a/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java b/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
index 42cb2c6..7584c7d 100644
--- a/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
+++ b/src/test/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategyTest.java
@@ -190,11 +190,11 @@
         new SingleBuildFileCache(execRoot.getPathString(), execRoot.getFileSystem()),
         ActionInputPrefetcher.NONE,
         new ActionKeyContext(),
-        null,
+        /*metadataHandler=*/ null,
         outErr,
-        executor.getEventHandler(),
-        ImmutableMap.of(),
-        ImmutableMap.of(),
+        reporter,
+        /*clientEnv=*/ ImmutableMap.of(),
+        /*topLevelFilesets=*/ ImmutableMap.of(),
         SIMPLE_ARTIFACT_EXPANDER,
         /*actionFileSystem=*/ null,
         /*skyframeDepsResult=*/ null);