more tests 4

This commit is contained in:
2024-06-23 18:17:26 +02:00
parent 5e346eb01b
commit f962ef0e38
3 changed files with 5 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ public class RemoteObjectServiceServer implements DhfsObjectSyncGrpc {
if (!obj.tryLocalResolve()) {
Log.info("<-- getObject FAIL: " + request.getName() + " from " + request.getSelfUuid());
throw new StatusRuntimeException(Status.UNAVAILABLE.withDescription("Not available locally"));
throw new StatusRuntimeException(Status.ABORTED.withDescription("Not available locally"));
}
//FIXME:
Pair<ObjectHeader, ByteString> read = obj.runReadLocked((meta, data) -> Pair.of(meta.toRpcHeader(), SerializationHelper.serialize(data)));

View File

@@ -40,7 +40,9 @@ public class RpcClientFactory {
try {
return withObjSyncClient(hostinfo.getAddr(), hostinfo.getPort(), Optional.empty(), fn);
} catch (StatusRuntimeException e) {
if (e.getStatus().equals(Status.UNAVAILABLE)) {
if (e.getStatus().equals(Status.ABORTED)) {
continue;
} else if (e.getStatus().equals(Status.UNAVAILABLE)) {
Log.info("Host " + target + " is unreachable: " + e.getMessage());
remoteHostManager.handleConnectionError(target);
} else throw e;

View File

@@ -110,7 +110,7 @@ public class DhfsFusex3IT {
@Test
void readWriteFileTest() throws IOException, InterruptedException, TimeoutException {
Assertions.assertEquals(0, container1.execInContainer("/bin/sh", "-c", "echo test123 > /root/dhfs_data/dhfs_fuse_root/testf1").getExitCode());
Thread.sleep(400);
Thread.sleep(1000);
Assertions.assertEquals("test123\n", container2.execInContainer("/bin/sh", "-c", "cat /root/dhfs_data/dhfs_fuse_root/testf1").getStdout());
Assertions.assertEquals("test123\n", container3.execInContainer("/bin/sh", "-c", "cat /root/dhfs_data/dhfs_fuse_root/testf1").getStdout());
}