mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
more tests 4
This commit is contained in:
@@ -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)));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user