veyron/services/mgmt/node/impl: wait for SetNamespaceRootsCommand to finish.
This fixes a race between running the modules function setting the local
namespace's roots (which runs in a goroutine), and using the local namespace to
mount services like the mock app repository. If the phase of the moon was right,
the app repository would try to publish itself before the roots were set, and
was therefore attempting to use the roots that had been set by a previous test
case's shell. Exhacerbating the issue was the fact that the attempt at resetting
of the roots to "" that was supposedly happening at the end of the deferred
cleanup function was actually a no-op: Namespace.SetRoots() rejects empty
strings as invalid roots, so sh.Start(core.SetNamespaceRootsCommand, nil, "")
would be failing silently.
This CL makes three changes:
(1) wait for the SetNamespaceRootsCommand command to complete before proceeding
(2) instead of sh.Start(core.SetNamespaceRootsCommand, nil, ""), try to reset
the roots to what they were before
(3) no longer expect at least one arg in SetNamespaceRootsCommand (so passing no
args should result in the roots being set to empty set).
Should fix go/vissues/408.
Change-Id: I3f5ef93bd62ea062d02074863ea0df6fa1768398
2 files changed