veyron/runtimes/google/ipc: refactor Listen loop code - back from the rollback...
- deleted commented out old code.
- cleaned up Listen implementation, the only behavioural difference
is that we now publish both local+proxy addresses for objects that
are being proxied.
- cleaned up the proxy retry loop.
- made it possible to use the proxy without a local listener.
- Dial takes a timeout argument.
Change-Id: Ia7598de824593b937d9d562f0597c7dc4100f88e
diff --git a/runtimes/google/ipc/full_test.go b/runtimes/google/ipc/full_test.go
index 0cb0709..d9209f4 100644
--- a/runtimes/google/ipc/full_test.go
+++ b/runtimes/google/ipc/full_test.go
@@ -5,7 +5,9 @@
"fmt"
"io"
"net"
+ "path/filepath"
"reflect"
+ "runtime"
"strings"
"sync"
"testing"
@@ -189,15 +191,23 @@
return ep, server
}
-func verifyMount(t *testing.T, ns naming.Namespace, name string) {
- if _, err := ns.Resolve(testContext(), name); err != nil {
- t.Errorf("%s not found in mounttable", name)
+func loc(d int) string {
+ _, file, line, _ := runtime.Caller(d + 1)
+ return fmt.Sprintf("%s:%d", filepath.Base(file), line)
+}
+
+func verifyMount(t *testing.T, ns naming.Namespace, name string) []string {
+ addrs, err := ns.Resolve(testContext(), name)
+ if err != nil {
+ t.Errorf("%s: %s not found in mounttable", loc(1), name)
+ return nil
}
+ return addrs
}
func verifyMountMissing(t *testing.T, ns naming.Namespace, name string) {
if servers, err := ns.Resolve(testContext(), name); err == nil {
- t.Errorf("%s not supposed to be found in mounttable; got %d servers instead", name, len(servers))
+ t.Errorf("%s: %s not supposed to be found in mounttable; got %d servers instead", loc(1), name, len(servers))
}
}