def open_background(self, basename="background_file"):
"""
Open a file for writing, then block such that the client
- will hold a capability
+ will hold a capability.
+
+ Don't return until the remote process has got as far as opening
+ the file, then return the RemoteProcess instance.
"""
assert(self.is_mounted())
rproc = self._run_python(pyscript)
self.background_procs.append(rproc)
+
+ # This wait would not be sufficient if the file had already
+ # existed, but it's simple and in practice users of open_background
+ # are not using it on existing files.
+ self.wait_for_visible(basename)
+
return rproc
def wait_for_visible(self, basename="background_file", timeout=30):