From 47b7a9baaab87f71706e2f605c122721962bba88 Mon Sep 17 00:00:00 2001 From: Jim MacArthur Date: Tue, 27 Nov 2018 18:07:52 +0000 Subject: _sandboxremote.py: Remove unnecessary tests. push_message and push_directory will both raise assertion failures if they fail to send the digest to the server. Checking the digest returned by each only tests that the content was hashed locally, which cannot reasonably fail. --- buildstream/sandbox/_sandboxremote.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/buildstream/sandbox/_sandboxremote.py b/buildstream/sandbox/_sandboxremote.py index 54946ca09..c366b3f40 100644 --- a/buildstream/sandbox/_sandboxremote.py +++ b/buildstream/sandbox/_sandboxremote.py @@ -139,8 +139,7 @@ class SandboxRemote(Sandbox): # Upload the Command message to the remote CAS server command_digest = cascache.push_message(casremote, remote_command) - if not command_digest or not cascache.verify_digest_on_remote(casremote, command_digest): - raise SandboxError("Failed pushing build command to remote CAS.") + # Create and send the action. action = remote_execution_pb2.Action(command_digest=command_digest, input_root_digest=input_root_digest, @@ -149,8 +148,6 @@ class SandboxRemote(Sandbox): # Upload the Action message to the remote CAS server action_digest = cascache.push_message(casremote, action) - if not action_digest or not cascache.verify_digest_on_remote(casremote, action_digest): - raise SandboxError("Failed pushing build action to remote CAS.") # Next, try to create a communication channel to the BuildGrid server. url = urlparse(self.exec_url) @@ -299,15 +296,11 @@ class SandboxRemote(Sandbox): casremote = CASRemote(self.storage_remote_spec) # Now, push that key (without necessarily needing a ref) to the remote. - try: cascache.push_directory(casremote, upload_vdir) except grpc.RpcError as e: raise SandboxError("Failed to push source directory to remote: {}".format(e)) from e - if not cascache.verify_digest_on_remote(casremote, upload_vdir.ref): - raise SandboxError("Failed to verify that source has been pushed to the remote artifact cache.") - # Now transmit the command to execute operation = self.run_remote_command(command, upload_vdir.ref, cwd, env) -- cgit v1.2.1