| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package coordinator | 5 package coordinator |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "sync" | 9 "sync" |
| 10 "sync/atomic" | 10 "sync/atomic" |
| 11 "testing" | 11 "testing" |
| 12 "time" | 12 "time" |
| 13 | 13 |
| 14 "github.com/luci/luci-go/common/clock/testclock" | 14 "github.com/luci/luci-go/common/clock/testclock" |
| 15 "github.com/luci/luci-go/common/errors" | 15 "github.com/luci/luci-go/common/errors" |
| 16 "github.com/luci/luci-go/logdog/common/types" | 16 "github.com/luci/luci-go/logdog/common/types" |
| 17 "github.com/luci/luci-go/luci_config/common/cfgtypes" | 17 "github.com/luci/luci-go/luci_config/common/cfgtypes" |
| 18 |
| 18 "golang.org/x/net/context" | 19 "golang.org/x/net/context" |
| 19 | 20 |
| 20 . "github.com/smartystreets/goconvey/convey" | 21 . "github.com/smartystreets/goconvey/convey" |
| 21 ) | 22 ) |
| 22 | 23 |
| 23 // testCoordinator is an implementation of Coordinator that can be used for | 24 // testCoordinator is an implementation of Coordinator that can be used for |
| 24 // testing. | 25 // testing. |
| 25 type testCoordinator struct { | 26 type testCoordinator struct { |
| 26 // calls is the number of calls made to the interface's methods. | 27 // calls is the number of calls made to the interface's methods. |
| 27 calls int32 | 28 calls int32 |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 remotes := 0 | 388 remotes := 0 |
| 388 for i := 0; i < count; i++ { | 389 for i := 0; i < count; i++ { |
| 389 if state[i].ProtoVersion == "remote" { | 390 if state[i].ProtoVersion == "remote" { |
| 390 remotes++ | 391 remotes++ |
| 391 } | 392 } |
| 392 } | 393 } |
| 393 So(remotes, ShouldEqual, count) | 394 So(remotes, ShouldEqual, count) |
| 394 }) | 395 }) |
| 395 }) | 396 }) |
| 396 } | 397 } |
| OLD | NEW |