projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '20138-fix-sync-test-race'
[arvados.git]
/
sdk
/
go
/
keepclient
/
root_sorter_test.go
diff --git
a/sdk/go/keepclient/root_sorter_test.go
b/sdk/go/keepclient/root_sorter_test.go
index 455715d427ef8ac06f478adef20818058331a45a..a6fbaeded37ad68ac78ae307c85c41647fdb5f1e 100644
(file)
--- a/
sdk/go/keepclient/root_sorter_test.go
+++ b/
sdk/go/keepclient/root_sorter_test.go
@@
-1,3
+1,7
@@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: Apache-2.0
+
package keepclient
import (
package keepclient
import (
@@
-8,20
+12,21
@@
import (
)
type RootSorterSuite struct{}
)
type RootSorterSuite struct{}
+
var _ = Suite(&RootSorterSuite{})
var _ = Suite(&RootSorterSuite{})
-func FakeSvcRoot(i uint64)
(string)
{
+func FakeSvcRoot(i uint64)
string
{
return fmt.Sprintf("https://%x.svc/", i)
}
return fmt.Sprintf("https://%x.svc/", i)
}
-func FakeSvcU
uid(i uint64) (string)
{
+func FakeSvcU
UID(i uint64) string
{
return fmt.Sprintf("zzzzz-bi6l4-%015x", i)
}
return fmt.Sprintf("zzzzz-bi6l4-%015x", i)
}
-func FakeServiceRoots(n uint64)
(map[string]string)
{
+func FakeServiceRoots(n uint64)
map[string]string
{
sr := map[string]string{}
sr := map[string]string{}
- for i := uint64(0); i < n; i
++ {
- sr[FakeSvcU
uid
(i)] = FakeSvcRoot(i)
+ for i := uint64(0); i < n; i++ {
+ sr[FakeSvcU
UID
(i)] = FakeSvcRoot(i)
}
return sr
}
}
return sr
}
@@
-40,19
+45,19
@@
func (*RootSorterSuite) ReferenceSet(c *C) {
fakeroots := FakeServiceRoots(16)
// These reference probe orders are explained further in
// ../../python/tests/test_keep_client.py:
fakeroots := FakeServiceRoots(16)
// These reference probe orders are explained further in
// ../../python/tests/test_keep_client.py:
- expected
_o
rders := []string{
+ expected
O
rders := []string{
"3eab2d5fc9681074",
"097dba52e648f1c3",
"c5b4e023f8a7d691",
"9d81c02e76a3bf54",
}
"3eab2d5fc9681074",
"097dba52e648f1c3",
"c5b4e023f8a7d691",
"9d81c02e76a3bf54",
}
- for h, expected
_order := range expected_o
rders {
+ for h, expected
Order := range expectedO
rders {
hash := Md5String(fmt.Sprintf("%064x", h))
roots := NewRootSorter(fakeroots, hash).GetSortedRoots()
hash := Md5String(fmt.Sprintf("%064x", h))
roots := NewRootSorter(fakeroots, hash).GetSortedRoots()
- for i, svc
_id_s := range strings.Split(expected_o
rder, "") {
- svc
_id, err := strconv.ParseUint(svc_id_
s, 16, 64)
+ for i, svc
IDs := range strings.Split(expectedO
rder, "") {
+ svc
ID, err := strconv.ParseUint(svcID
s, 16, 64)
c.Assert(err, Equals, nil)
c.Assert(err, Equals, nil)
- c.Check(roots[i], Equals, FakeSvcRoot(svc
_id
))
+ c.Check(roots[i], Equals, FakeSvcRoot(svc
ID
))
}
}
}
}
}
}