(id, zone string, tokens []uint32, registeredAt time.Time)
| 3903 | } |
| 3904 | |
| 3905 | func generateRingInstanceWithInfo(id, zone string, tokens []uint32, registeredAt time.Time) InstanceDesc { |
| 3906 | var regts int64 |
| 3907 | if !registeredAt.IsZero() { |
| 3908 | regts = registeredAt.Unix() |
| 3909 | } |
| 3910 | // Heartbeat timestamp should be recent (relative to test time), not the old registration time. |
| 3911 | // Use time.Now() to simulate an instance that has recently sent a heartbeat. |
| 3912 | return InstanceDesc{ |
| 3913 | Id: id, |
| 3914 | Addr: id, |
| 3915 | Timestamp: time.Now().Unix(), |
| 3916 | RegisteredTimestamp: regts, |
| 3917 | State: ACTIVE, |
| 3918 | Tokens: tokens, |
| 3919 | Zone: zone, |
| 3920 | } |
| 3921 | } |
| 3922 | |
| 3923 | // compareReplicationSets returns the list of instance addresses which differ between the two sets. |
| 3924 | func compareReplicationSets(first, second ReplicationSet) (added, removed []string) { |
no outgoing calls
no test coverage detected