Completely Remove FutureMessage from RPC cpp tests (#50027)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/50027

Test Plan: Imported from OSS

Reviewed By: lw

Differential Revision: D25753815

Pulled By: mrshenli

fbshipit-source-id: 85b9b03fec52b4175288ac3a401285607744b451
diff --git a/test/cpp/rpc/e2e_test_base.h b/test/cpp/rpc/e2e_test_base.h
index 61d9a73..cea5079 100644
--- a/test/cpp/rpc/e2e_test_base.h
+++ b/test/cpp/rpc/e2e_test_base.h
@@ -90,14 +90,15 @@
     ScriptCall scriptCall(op, {t1, t2, /* alpha */ 1});
 
     // Send the RPC and return result.
-    auto response = RpcAgent::toFutureMessage(
-        autograd::sendMessageWithAutograd(
-            *rpcAgent,
-            rpcAgent->getWorkerInfo("worker"),
-            std::move(scriptCall).toMessage()))
-        ->wait();
+    auto response = autograd::sendMessageWithAutograd(
+        *rpcAgent,
+        rpcAgent->getWorkerInfo("worker"),
+        std::move(scriptCall).toMessage());
+    response->waitAndThrow();
+
     MessageType messageType = MessageType::FORWARD_AUTOGRAD_RESP;
-    auto wrappedResponse = deserializeResponse(response, messageType);
+    auto wrappedResponse = deserializeResponse(
+        std::move(*response->value().toCustomClass<Message>()), messageType);
     return static_cast<ScriptResp&>(*wrappedResponse).value().toTensor();
   }