Skip to content

Commit 9938118

Browse files
committed
Fix up bazel-buildfarm to pass all tests
1 parent d6c1859 commit 9938118

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import build.buildfarm.cas.ContentAddressableStorage;
4141
import build.buildfarm.cas.cfc.CASFileCache;
4242
import build.buildfarm.common.BuildfarmExecutors;
43+
import build.buildfarm.common.DigestUtil;
4344
import build.buildfarm.common.io.Directories;
4445
import build.buildfarm.common.io.Dirent;
4546
import build.buildfarm.worker.ExecDirException;

src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ private void insertFileToCasMember(Digest digest, DigestFunction.Value digestFun
8181
}
8282
}
8383

84-
private long writeToCasMember(Digest digest, InputStream in)
85-
throws IOException, InterruptedException {
8684
private long writeToCasMember(Digest digest, DigestFunction.Value digestFunction, InputStream in)
8785
throws IOException, InterruptedException {
8886
// create a write for inserting into another CAS member.

src/main/java/build/buildfarm/worker/shard/Worker.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@
9797
import javax.annotation.Nullable;
9898
import javax.naming.ConfigurationException;
9999
import lombok.extern.java.Log;
100-
import org.springframework.beans.factory.annotation.Autowired;
101-
import org.springframework.boot.SpringApplication;
102-
import org.springframework.boot.autoconfigure.SpringBootApplication;
103-
import org.springframework.context.ApplicationContext;
104-
import org.springframework.context.annotation.ComponentScan;
105100

106101
@Log
107102
public final class Worker extends LoggingMain {
@@ -146,7 +141,6 @@ public final class Worker extends LoggingMain {
146141
private LoadingCache<String, Instance> workerStubs;
147142
private AtomicBoolean released = new AtomicBoolean(true);
148143

149-
@Autowired private ApplicationContext springContext;
150144
/**
151145
* The method will prepare the worker for graceful shutdown when the worker is ready. Note on
152146
* using stderr here instead of log. By the time this is called in PreDestroy, the log is no
@@ -227,10 +221,9 @@ public void run() {
227221

228222
// Consider defining exit codes to better afford out of band instance
229223
// recovery
230-
int code = SpringApplication.exit(springContext, () -> 1);
231224
termFuture.cancel(false);
232225
shutdownDeadlineExecutor.shutdown();
233-
System.exit(code);
226+
System.exit(0);
234227
}
235228

236229
private Operation stripOperation(Operation operation) {

src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public void noErrorWhenContextCancelled() throws Exception {
115115
when(instance.getBlobWrite(
116116
eq(Compressor.Value.IDENTITY),
117117
eq(cancelledDigest),
118+
eq(DigestFunction.Value.UNKNOWN),
118119
eq(uuid),
119120
any(RequestMetadata.class)))
120121
.thenReturn(write);
@@ -137,6 +138,7 @@ public void noErrorWhenContextCancelled() throws Exception {
137138
.getBlobWrite(
138139
eq(Compressor.Value.IDENTITY),
139140
eq(cancelledDigest),
141+
eq(DigestFunction.Value.UNKNOWN),
140142
eq(uuid),
141143
any(RequestMetadata.class));
142144
verifyNoInteractions(responseObserver);

src/test/java/build/buildfarm/worker/PipelineTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void stageExitsOnInterrupt() throws InterruptedException {
110110
Pipeline pipeline = new Pipeline();
111111
TestStage stage = new TestStage("test");
112112
pipeline.add(stage, 1);
113-
pipeline.start();
113+
pipeline.start(null);
114114
pipeline.join();
115115
}
116116

@@ -147,7 +147,7 @@ public void stageContinuesOnException() throws InterruptedException {
147147
Pipeline pipeline = new Pipeline();
148148
ContinueStage stage = new ContinueStage("test");
149149
pipeline.add(stage, 1);
150-
pipeline.start();
150+
pipeline.start(null);
151151

152152
boolean didNotThrow = false;
153153
try {

0 commit comments

Comments
 (0)