Only set local execution delay in dynamic execution when getting a cache hit from remote. There is no reason to delay after getting a remote execution.
@@ -685,7 +685,12 @@ public class DynamicSpawnStrategy implements SpawnStrategy {
DynamicSpawnStrategy.this.options,
actionExecutionContext,
spawn));
+ for (SpawnResult r : spawnResults) {
+ if (r.isCacheHit()) {
delayLocalExecution.set(true);
+ break;
+ }
+ }
return spawnResults;
} catch (DynamicInterruptedException e) {
// This exception can be thrown due to races in stopBranch(), in which case
