9437: Report timestamps as nanoseconds since epoch in keepstore index.
[arvados.git] / services / keep-balance / balance_test.go
index 682a5fb070cf0ab7e8a2b0fff0bb92a750622e06..b93939c0526d3c1f8bb7da93fe1f9915ad74c6cc 100644 (file)
@@ -76,7 +76,7 @@ func (bal *balancerSuite) SetUpTest(c *check.C) {
                bal.KeepServices[srv.UUID] = srv
        }
 
-       bal.MinMtime = time.Now().Unix() - bal.signatureTTL
+       bal.MinMtime = time.Now().UnixNano() - bal.signatureTTL*1e9
 }
 
 func (bal *balancerSuite) TestPerfect(c *check.C) {
@@ -240,7 +240,7 @@ func (bal *balancerSuite) srvList(knownBlockID int, order slots) (srvs []*KeepSe
 // replList is like srvList but returns an "existing replicas" slice,
 // suitable for a BlockState test fixture.
 func (bal *balancerSuite) replList(knownBlockID int, order slots) (repls []Replica) {
-       mtime := time.Now().Unix() - bal.signatureTTL - 86400
+       mtime := time.Now().UnixNano() - (bal.signatureTTL+86400)*1e9
        for _, srv := range bal.srvList(knownBlockID, order) {
                repls = append(repls, Replica{srv, mtime})
                mtime++