Search in sources :

Example 1 with NullWrite

use of build.buildfarm.common.Write.NullWrite in project bazel-buildfarm by bazelbuild.

the class CASFileCacheTest method interruptDeferredDuringExpirations.

@SuppressWarnings("unchecked")
@Test
public void interruptDeferredDuringExpirations() throws IOException, InterruptedException {
    Blob expiringBlob;
    try (ByteString.Output out = ByteString.newOutput(1024)) {
        for (int i = 0; i < 1024; i++) {
            out.write(0);
        }
        expiringBlob = new Blob(out.toByteString(), DIGEST_UTIL);
    }
    fileCache.put(expiringBlob);
    // state of CAS
    // 1024-byte key
    AtomicReference<Throwable> exRef = new AtomicReference(null);
    // 0 = not blocking
    // 1 = blocking
    // 2 = delegate write
    AtomicInteger writeState = new AtomicInteger(0);
    // this will ensure that the discharge task is blocked until we release it
    Future<Void> blockingExpiration = expireService.submit(() -> {
        writeState.getAndIncrement();
        while (writeState.get() != 0) {
            try {
                MICROSECONDS.sleep(1);
            } catch (InterruptedException e) {
            // ignore
            }
        }
        return null;
    });
    when(delegate.getWrite(eq(expiringBlob.getDigest()), any(UUID.class), any(RequestMetadata.class))).thenReturn(new NullWrite() {

        @Override
        public FeedbackOutputStream getOutput(long deadlineAfter, TimeUnit deadlineAfterUnits, Runnable onReadyHandler) throws IOException {
            try {
                while (writeState.get() != 1) {
                    MICROSECONDS.sleep(1);
                }
            } catch (InterruptedException e) {
                throw new IOException(e);
            }
            // move into output stream state
            writeState.getAndIncrement();
            return super.getOutput(deadlineAfter, deadlineAfterUnits, onReadyHandler);
        }
    });
    Thread expiringThread = new Thread(() -> {
        try {
            fileCache.put(new Blob(ByteString.copyFromUtf8("Hello, World"), DIGEST_UTIL));
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        fail("should not get here");
    });
    expiringThread.setUncaughtExceptionHandler((t, e) -> exRef.set(e));
    // wait for blocking state
    while (writeState.get() != 1) {
        MICROSECONDS.sleep(1);
    }
    expiringThread.start();
    while (writeState.get() != 2) {
        MICROSECONDS.sleep(1);
    }
    // expiry has been initiated, thread should be waiting
    // just trying to ensure that we've reached the future wait point
    MICROSECONDS.sleep(10);
    // hopefully this will be scheduled *after* the discharge task
    Future<Void> completedExpiration = expireService.submit(() -> null);
    // interrupt it
    expiringThread.interrupt();
    assertThat(expiringThread.isAlive()).isTrue();
    assertThat(completedExpiration.isDone()).isFalse();
    writeState.set(0);
    while (!blockingExpiration.isDone()) {
        MICROSECONDS.sleep(1);
    }
    expiringThread.join();
    // CAS should now be empty due to expiration and failed put
    while (!completedExpiration.isDone()) {
        MICROSECONDS.sleep(1);
    }
    assertThat(fileCache.size()).isEqualTo(0);
    Throwable t = exRef.get();
    assertThat(t).isNotNull();
    t = t.getCause();
    assertThat(t).isNotNull();
    assertThat(t).isInstanceOf(InterruptedException.class);
}
Also used : Blob(build.buildfarm.cas.ContentAddressableStorage.Blob) ByteString(com.google.protobuf.ByteString) AtomicReference(java.util.concurrent.atomic.AtomicReference) Utils.getInterruptiblyOrIOException(build.buildfarm.common.io.Utils.getInterruptiblyOrIOException) IOException(java.io.IOException) FeedbackOutputStream(build.buildfarm.common.io.FeedbackOutputStream) RequestMetadata(build.bazel.remote.execution.v2.RequestMetadata) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) NullWrite(build.buildfarm.common.Write.NullWrite) TimeUnit(java.util.concurrent.TimeUnit) UUID(java.util.UUID) Test(org.junit.Test)

Example 2 with NullWrite

use of build.buildfarm.common.Write.NullWrite in project bazel-buildfarm by bazelbuild.

the class CASFileCacheTest method readThroughSwitchedToLocalContinues.

@Test
public void readThroughSwitchedToLocalContinues() throws Exception {
    ByteString content = ByteString.copyFromUtf8("Hello, World");
    Blob blob = new Blob(content, DIGEST_UTIL);
    ExecutorService service = newSingleThreadExecutor();
    SettableFuture<Void> writeComplete = SettableFuture.create();
    // we need to register callbacks on the shared write future
    Write write = new NullWrite() {

        @Override
        public ListenableFuture<Long> getFuture() {
            return Futures.transform(writeComplete, result -> blob.getDigest().getSizeBytes(), directExecutor());
        }

        @Override
        public FeedbackOutputStream getOutput(long deadlineAfter, TimeUnit deadlineAfterUnits, Runnable onReadyHandler) {
            return new FeedbackOutputStream() {

                int offset = 0;

                @Override
                public void write(int b) {
                    throw new UnsupportedOperationException();
                }

                @Override
                public void write(byte[] buf, int ofs, int len) throws IOException {
                    // hangs on second read
                    if (offset == 6) {
                        service.submit(() -> writeComplete.set(null));
                        throw new ClosedChannelException();
                    }
                    offset += len;
                }

                @Override
                public boolean isReady() {
                    return true;
                }
            };
        }
    };
    when(delegate.getWrite(eq(blob.getDigest()), any(UUID.class), any(RequestMetadata.class))).thenReturn(write);
    when(delegate.newInput(eq(blob.getDigest()), eq(0L))).thenReturn(content.newInput());
    // the switch will reset to this point
    InputStream switchedIn = content.newInput();
    switchedIn.skip(6);
    when(delegate.newInput(eq(blob.getDigest()), eq(6L))).thenReturn(switchedIn);
    InputStream in = fileCache.newReadThroughInput(blob.getDigest(), 0, write);
    byte[] buf = new byte[content.size()];
    // advance to the middle of the content
    assertThat(in.read(buf, 0, 6)).isEqualTo(6);
    assertThat(ByteString.copyFrom(buf, 0, 6)).isEqualTo(content.substring(0, 6));
    verify(delegate, times(1)).newInput(blob.getDigest(), 0L);
    // read the remaining content
    int remaining = content.size() - 6;
    assertThat(in.read(buf, 6, remaining)).isEqualTo(remaining);
    assertThat(ByteString.copyFrom(buf)).isEqualTo(content);
    if (!shutdownAndAwaitTermination(service, 1, SECONDS)) {
        throw new RuntimeException("could not shut down service");
    }
}
Also used : NullWrite(build.buildfarm.common.Write.NullWrite) Write(build.buildfarm.common.Write) ClosedChannelException(java.nio.channels.ClosedChannelException) Blob(build.buildfarm.cas.ContentAddressableStorage.Blob) ByteString(com.google.protobuf.ByteString) InputStream(java.io.InputStream) FeedbackOutputStream(build.buildfarm.common.io.FeedbackOutputStream) RequestMetadata(build.bazel.remote.execution.v2.RequestMetadata) NullWrite(build.buildfarm.common.Write.NullWrite) ExecutorService(java.util.concurrent.ExecutorService) TimeUnit(java.util.concurrent.TimeUnit) UUID(java.util.UUID) Test(org.junit.Test)

Example 3 with NullWrite

use of build.buildfarm.common.Write.NullWrite in project bazel-buildfarm by bazelbuild.

the class CASFileCacheTest method setUp.

@Before
public void setUp() throws IOException, InterruptedException {
    MockitoAnnotations.initMocks(this);
    when(delegate.getWrite(any(Digest.class), any(UUID.class), any(RequestMetadata.class))).thenReturn(new NullWrite());
    when(delegate.newInput(any(Digest.class), any(Long.class))).thenThrow(new NoSuchFileException("null sink delegate"));
    blobs = Maps.newHashMap();
    putService = newSingleThreadExecutor();
    storage = Maps.newConcurrentMap();
    expireService = newSingleThreadExecutor();
    fileCache = new CASFileCache(root, /* maxSizeInBytes=*/
    1024, /* maxEntrySizeInBytes=*/
    1024, /* hexBucketLevels=*/
    1, storeFileDirsIndexInMemory, DIGEST_UTIL, expireService, /* accessRecorder=*/
    directExecutor(), storage, /* directoriesIndexDbName=*/
    ":memory:", onPut, onExpire, delegate) {

        @Override
        protected InputStream newExternalInput(Digest digest) throws IOException {
            ByteString content = blobs.get(digest);
            if (content == null) {
                return fileCache.newTransparentInput(digest, 0);
            }
            return content.substring((int) (long) 0).newInput();
        }
    };
    // do this so that we can remove the cache root dir
    fileCache.initializeRootDirectory();
}
Also used : Digest(build.bazel.remote.execution.v2.Digest) InputStream(java.io.InputStream) ByteString(com.google.protobuf.ByteString) NullWrite(build.buildfarm.common.Write.NullWrite) NoSuchFileException(java.nio.file.NoSuchFileException) Utils.getInterruptiblyOrIOException(build.buildfarm.common.io.Utils.getInterruptiblyOrIOException) IOException(java.io.IOException) UUID(java.util.UUID) RequestMetadata(build.bazel.remote.execution.v2.RequestMetadata) Before(org.junit.Before)

Example 4 with NullWrite

use of build.buildfarm.common.Write.NullWrite in project bazel-buildfarm by bazelbuild.

the class ShardInstanceTest method queueWithFailedCacheCheckContinues.

@Test
public void queueWithFailedCacheCheckContinues() throws Exception {
    Action action = createAction();
    ActionKey actionKey = DIGEST_UTIL.computeActionKey(action);
    ExecuteEntry executeEntry = ExecuteEntry.newBuilder().setOperationName("operation-with-erroring-action-result").setActionDigest(actionKey.getDigest()).build();
    when(mockBackplane.propertiesEligibleForQueue(Matchers.anyList())).thenReturn(true);
    when(mockBackplane.canQueue()).thenReturn(true);
    when(mockBackplane.getActionResult(eq(actionKey))).thenThrow(new IOException(Status.UNAVAILABLE.asException()));
    doAnswer(answer((digest, uuid) -> new NullWrite())).when(mockWorkerInstance).getBlobWrite(any(Digest.class), any(UUID.class), any(RequestMetadata.class));
    Poller poller = mock(Poller.class);
    instance.queue(executeEntry, poller, DEFAULT_TIMEOUT).get(QUEUE_TEST_TIMEOUT_SECONDS, SECONDS);
    verify(mockBackplane, times(1)).queue(any(QueueEntry.class), any(Operation.class));
    verify(mockBackplane, times(1)).putOperation(any(Operation.class), eq(CACHE_CHECK));
    verify(poller, atLeastOnce()).pause();
}
Also used : ExecuteOperationMetadata(build.bazel.remote.execution.v2.ExecuteOperationMetadata) AsyncCache(com.github.benmanes.caffeine.cache.AsyncCache) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) DirectoryNode(build.bazel.remote.execution.v2.DirectoryNode) ExecuteEntry(build.buildfarm.v1test.ExecuteEntry) RequestMetadata(build.bazel.remote.execution.v2.RequestMetadata) Actions.invalidActionVerboseMessage(build.buildfarm.common.Actions.invalidActionVerboseMessage) ActionKey(build.buildfarm.common.DigestUtil.ActionKey) Durations(com.google.protobuf.util.Durations) MISSING_ACTION(build.buildfarm.instance.server.AbstractServerInstance.MISSING_ACTION) ArgumentMatcher(org.mockito.ArgumentMatcher) MockitoAnnotations(org.mockito.MockitoAnnotations) StreamObserver(io.grpc.stub.StreamObserver) StatusProto(io.grpc.protobuf.StatusProto) Digest(build.bazel.remote.execution.v2.Digest) Mockito.doAnswer(org.mockito.Mockito.doAnswer) After(org.junit.After) COMPLETED(build.bazel.remote.execution.v2.ExecutionStage.Value.COMPLETED) Status(io.grpc.Status) INVALID_PLATFORM(build.buildfarm.instance.server.AbstractServerInstance.INVALID_PLATFORM) ServerCallStreamObserver(io.grpc.stub.ServerCallStreamObserver) ImmutableSet(com.google.common.collect.ImmutableSet) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Set(java.util.Set) Executors.newSingleThreadExecutor(java.util.concurrent.Executors.newSingleThreadExecutor) OutputFile(build.bazel.remote.execution.v2.OutputFile) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Instance(build.buildfarm.instance.Instance) Sets(com.google.common.collect.Sets) CacheLoader(com.google.common.cache.CacheLoader) ByteString(com.google.protobuf.ByteString) List(java.util.List) VIOLATION_TYPE_MISSING(build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING) HashFunction(build.buildfarm.common.DigestUtil.HashFunction) QueueEntry(build.buildfarm.v1test.QueueEntry) Any(com.google.protobuf.Any) CacheBuilder(com.google.common.cache.CacheBuilder) CACHE_CHECK(build.bazel.remote.execution.v2.ExecutionStage.Value.CACHE_CHECK) Mockito.any(org.mockito.Mockito.any) Mockito.eq(org.mockito.Mockito.eq) Mockito.mock(org.mockito.Mockito.mock) Directory(build.bazel.remote.execution.v2.Directory) MoreExecutors.listeningDecorator(com.google.common.util.concurrent.MoreExecutors.listeningDecorator) Iterables(com.google.common.collect.Iterables) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) Command(build.bazel.remote.execution.v2.Command) ToolDetails(build.bazel.remote.execution.v2.ToolDetails) Matchers(org.mockito.Matchers) Mock(org.mockito.Mock) MoreExecutors.newDirectExecutorService(com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService) RunWith(org.junit.runner.RunWith) MISSING_COMMAND(build.buildfarm.instance.server.AbstractServerInstance.MISSING_COMMAND) CompletableFuture(java.util.concurrent.CompletableFuture) QueuedOperation(build.buildfarm.v1test.QueuedOperation) ResultsCachePolicy(build.bazel.remote.execution.v2.ResultsCachePolicy) Operation(com.google.longrunning.Operation) Function(java.util.function.Function) DigestUtil(build.buildfarm.common.DigestUtil) QUEUED(build.bazel.remote.execution.v2.ExecutionStage.Value.QUEUED) Answer(org.mockito.stubbing.Answer) Action(build.bazel.remote.execution.v2.Action) NullWrite(build.buildfarm.common.Write.NullWrite) ArgumentCaptor(org.mockito.ArgumentCaptor) ImmutableList(com.google.common.collect.ImmutableList) Watcher(build.buildfarm.common.Watcher) VIOLATION_TYPE_INVALID(build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID) ActionResult(build.bazel.remote.execution.v2.ActionResult) AdditionalAnswers.answer(org.mockito.AdditionalAnswers.answer) StreamSupport(java.util.stream.StreamSupport) Code(com.google.rpc.Code) Before(org.junit.Before) Backplane(build.buildfarm.backplane.Backplane) Violation(com.google.rpc.PreconditionFailure.Violation) Futures.immediateFuture(com.google.common.util.concurrent.Futures.immediateFuture) Caffeine(com.github.benmanes.caffeine.cache.Caffeine) ExecutionPolicy(build.bazel.remote.execution.v2.ExecutionPolicy) Poller(build.buildfarm.common.Poller) PreconditionFailure(com.google.rpc.PreconditionFailure) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) JUnit4(org.junit.runners.JUnit4) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) StatusRuntimeException(io.grpc.StatusRuntimeException) ExecutionException(java.util.concurrent.ExecutionException) Mockito.never(org.mockito.Mockito.never) Duration(com.google.protobuf.Duration) ExecuteResponse(build.bazel.remote.execution.v2.ExecuteResponse) SECONDS(java.util.concurrent.TimeUnit.SECONDS) CompletedOperationMetadata(build.buildfarm.v1test.CompletedOperationMetadata) Action(build.bazel.remote.execution.v2.Action) Digest(build.bazel.remote.execution.v2.Digest) ExecuteEntry(build.buildfarm.v1test.ExecuteEntry) NullWrite(build.buildfarm.common.Write.NullWrite) ActionKey(build.buildfarm.common.DigestUtil.ActionKey) IOException(java.io.IOException) QueuedOperation(build.buildfarm.v1test.QueuedOperation) Operation(com.google.longrunning.Operation) UUID(java.util.UUID) QueueEntry(build.buildfarm.v1test.QueueEntry) Poller(build.buildfarm.common.Poller) RequestMetadata(build.bazel.remote.execution.v2.RequestMetadata) Test(org.junit.Test)

Example 5 with NullWrite

use of build.buildfarm.common.Write.NullWrite in project bazel-buildfarm by bazelbuild.

the class ShardInstanceTest method queueOperationPutFailureCancelsOperation.

@SuppressWarnings("unchecked")
@Test
public void queueOperationPutFailureCancelsOperation() throws Exception {
    Action action = createAction();
    Digest actionDigest = DIGEST_UTIL.compute(action);
    when(mockWorkerInstance.findMissingBlobs(any(Iterable.class), any(RequestMetadata.class))).thenReturn(immediateFuture(ImmutableList.of()));
    doAnswer(answer((digest, uuid) -> new NullWrite())).when(mockWorkerInstance).getBlobWrite(any(Digest.class), any(UUID.class), any(RequestMetadata.class));
    StatusRuntimeException queueException = Status.UNAVAILABLE.asRuntimeException();
    doAnswer((invocation) -> {
        throw new IOException(queueException);
    }).when(mockBackplane).queue(any(QueueEntry.class), any(Operation.class));
    ExecuteEntry executeEntry = ExecuteEntry.newBuilder().setOperationName("queue-operation-put-failure-cancels-operation").setActionDigest(actionDigest).setSkipCacheLookup(true).build();
    when(mockBackplane.propertiesEligibleForQueue(Matchers.anyList())).thenReturn(true);
    when(mockBackplane.canQueue()).thenReturn(true);
    Poller poller = mock(Poller.class);
    boolean unavailableExceptionCaught = false;
    try {
        // anything more would be unreasonable
        instance.queue(executeEntry, poller, DEFAULT_TIMEOUT).get(QUEUE_TEST_TIMEOUT_SECONDS, SECONDS);
    } catch (ExecutionException e) {
        com.google.rpc.Status status = StatusProto.fromThrowable(e);
        if (status.getCode() == Code.UNAVAILABLE.getNumber()) {
            unavailableExceptionCaught = true;
        } else {
            throw e;
        }
    }
    assertThat(unavailableExceptionCaught).isTrue();
    verify(mockBackplane, times(1)).queue(any(QueueEntry.class), any(Operation.class));
    ExecuteResponse executeResponse = ExecuteResponse.newBuilder().setStatus(com.google.rpc.Status.newBuilder().setCode(queueException.getStatus().getCode().value())).build();
    assertResponse(executeResponse);
    verify(poller, atLeastOnce()).pause();
}
Also used : ExecuteOperationMetadata(build.bazel.remote.execution.v2.ExecuteOperationMetadata) AsyncCache(com.github.benmanes.caffeine.cache.AsyncCache) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) DirectoryNode(build.bazel.remote.execution.v2.DirectoryNode) ExecuteEntry(build.buildfarm.v1test.ExecuteEntry) RequestMetadata(build.bazel.remote.execution.v2.RequestMetadata) Actions.invalidActionVerboseMessage(build.buildfarm.common.Actions.invalidActionVerboseMessage) ActionKey(build.buildfarm.common.DigestUtil.ActionKey) Durations(com.google.protobuf.util.Durations) MISSING_ACTION(build.buildfarm.instance.server.AbstractServerInstance.MISSING_ACTION) ArgumentMatcher(org.mockito.ArgumentMatcher) MockitoAnnotations(org.mockito.MockitoAnnotations) StreamObserver(io.grpc.stub.StreamObserver) StatusProto(io.grpc.protobuf.StatusProto) Digest(build.bazel.remote.execution.v2.Digest) Mockito.doAnswer(org.mockito.Mockito.doAnswer) After(org.junit.After) COMPLETED(build.bazel.remote.execution.v2.ExecutionStage.Value.COMPLETED) Status(io.grpc.Status) INVALID_PLATFORM(build.buildfarm.instance.server.AbstractServerInstance.INVALID_PLATFORM) ServerCallStreamObserver(io.grpc.stub.ServerCallStreamObserver) ImmutableSet(com.google.common.collect.ImmutableSet) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Set(java.util.Set) Executors.newSingleThreadExecutor(java.util.concurrent.Executors.newSingleThreadExecutor) OutputFile(build.bazel.remote.execution.v2.OutputFile) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Instance(build.buildfarm.instance.Instance) Sets(com.google.common.collect.Sets) CacheLoader(com.google.common.cache.CacheLoader) ByteString(com.google.protobuf.ByteString) List(java.util.List) VIOLATION_TYPE_MISSING(build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING) HashFunction(build.buildfarm.common.DigestUtil.HashFunction) QueueEntry(build.buildfarm.v1test.QueueEntry) Any(com.google.protobuf.Any) CacheBuilder(com.google.common.cache.CacheBuilder) CACHE_CHECK(build.bazel.remote.execution.v2.ExecutionStage.Value.CACHE_CHECK) Mockito.any(org.mockito.Mockito.any) Mockito.eq(org.mockito.Mockito.eq) Mockito.mock(org.mockito.Mockito.mock) Directory(build.bazel.remote.execution.v2.Directory) MoreExecutors.listeningDecorator(com.google.common.util.concurrent.MoreExecutors.listeningDecorator) Iterables(com.google.common.collect.Iterables) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) Command(build.bazel.remote.execution.v2.Command) ToolDetails(build.bazel.remote.execution.v2.ToolDetails) Matchers(org.mockito.Matchers) Mock(org.mockito.Mock) MoreExecutors.newDirectExecutorService(com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService) RunWith(org.junit.runner.RunWith) MISSING_COMMAND(build.buildfarm.instance.server.AbstractServerInstance.MISSING_COMMAND) CompletableFuture(java.util.concurrent.CompletableFuture) QueuedOperation(build.buildfarm.v1test.QueuedOperation) ResultsCachePolicy(build.bazel.remote.execution.v2.ResultsCachePolicy) Operation(com.google.longrunning.Operation) Function(java.util.function.Function) DigestUtil(build.buildfarm.common.DigestUtil) QUEUED(build.bazel.remote.execution.v2.ExecutionStage.Value.QUEUED) Answer(org.mockito.stubbing.Answer) Action(build.bazel.remote.execution.v2.Action) NullWrite(build.buildfarm.common.Write.NullWrite) ArgumentCaptor(org.mockito.ArgumentCaptor) ImmutableList(com.google.common.collect.ImmutableList) Watcher(build.buildfarm.common.Watcher) VIOLATION_TYPE_INVALID(build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID) ActionResult(build.bazel.remote.execution.v2.ActionResult) AdditionalAnswers.answer(org.mockito.AdditionalAnswers.answer) StreamSupport(java.util.stream.StreamSupport) Code(com.google.rpc.Code) Before(org.junit.Before) Backplane(build.buildfarm.backplane.Backplane) Violation(com.google.rpc.PreconditionFailure.Violation) Futures.immediateFuture(com.google.common.util.concurrent.Futures.immediateFuture) Caffeine(com.github.benmanes.caffeine.cache.Caffeine) ExecutionPolicy(build.bazel.remote.execution.v2.ExecutionPolicy) Poller(build.buildfarm.common.Poller) PreconditionFailure(com.google.rpc.PreconditionFailure) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) JUnit4(org.junit.runners.JUnit4) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) StatusRuntimeException(io.grpc.StatusRuntimeException) ExecutionException(java.util.concurrent.ExecutionException) Mockito.never(org.mockito.Mockito.never) Duration(com.google.protobuf.Duration) ExecuteResponse(build.bazel.remote.execution.v2.ExecuteResponse) SECONDS(java.util.concurrent.TimeUnit.SECONDS) CompletedOperationMetadata(build.buildfarm.v1test.CompletedOperationMetadata) Status(io.grpc.Status) Action(build.bazel.remote.execution.v2.Action) Digest(build.bazel.remote.execution.v2.Digest) ExecuteEntry(build.buildfarm.v1test.ExecuteEntry) ExecuteResponse(build.bazel.remote.execution.v2.ExecuteResponse) IOException(java.io.IOException) QueuedOperation(build.buildfarm.v1test.QueuedOperation) Operation(com.google.longrunning.Operation) QueueEntry(build.buildfarm.v1test.QueueEntry) RequestMetadata(build.bazel.remote.execution.v2.RequestMetadata) NullWrite(build.buildfarm.common.Write.NullWrite) StatusRuntimeException(io.grpc.StatusRuntimeException) UUID(java.util.UUID) ExecutionException(java.util.concurrent.ExecutionException) Poller(build.buildfarm.common.Poller) Test(org.junit.Test)

Aggregations

NullWrite (build.buildfarm.common.Write.NullWrite)6 ByteString (com.google.protobuf.ByteString)6 RequestMetadata (build.bazel.remote.execution.v2.RequestMetadata)5 IOException (java.io.IOException)5 UUID (java.util.UUID)4 Digest (build.bazel.remote.execution.v2.Digest)3 Test (org.junit.Test)3 Action (build.bazel.remote.execution.v2.Action)2 ActionResult (build.bazel.remote.execution.v2.ActionResult)2 Command (build.bazel.remote.execution.v2.Command)2 Directory (build.bazel.remote.execution.v2.Directory)2 DirectoryNode (build.bazel.remote.execution.v2.DirectoryNode)2 ExecuteOperationMetadata (build.bazel.remote.execution.v2.ExecuteOperationMetadata)2 ExecuteResponse (build.bazel.remote.execution.v2.ExecuteResponse)2 ExecutionPolicy (build.bazel.remote.execution.v2.ExecutionPolicy)2 CACHE_CHECK (build.bazel.remote.execution.v2.ExecutionStage.Value.CACHE_CHECK)2 COMPLETED (build.bazel.remote.execution.v2.ExecutionStage.Value.COMPLETED)2 QUEUED (build.bazel.remote.execution.v2.ExecutionStage.Value.QUEUED)2 OutputFile (build.bazel.remote.execution.v2.OutputFile)2 ResultsCachePolicy (build.bazel.remote.execution.v2.ResultsCachePolicy)2