7 "git.curoverse.com/arvados.git/sdk/go/arvados"
8 check "gopkg.in/check.v1"
11 // TestIdenticalTimestamps ensures EachCollection returns the same
12 // set of collections for various page sizes -- even page sizes so
13 // small that we get entire pages full of collections with identical
14 // timestamps and exercise our gettingExactTimestamp cases.
15 func (s *integrationSuite) TestIdenticalTimestamps(c *check.C) {
16 // pageSize==0 uses the default (large) page size.
17 pageSizes := []int{0, 2, 3, 4, 5}
18 got := make([][]string, len(pageSizes))
20 for trial, pageSize := range pageSizes {
22 go func(trial, pageSize int) {
27 sawUUID := make(map[string]bool)
28 err := EachCollection(&s.config.Client, pageSize, func(c arvados.Collection) error {
29 got[trial] = append(got[trial], c.UUID)
30 if c.ModifiedAt == nil {
37 sawUUID[c.UUID] = true
38 if lastMod == *c.ModifiedAt {
40 if streak > longestStreak {
41 longestStreak = streak
45 lastMod = *c.ModifiedAt
49 c.Check(err, check.IsNil)
50 c.Check(longestStreak > 25, check.Equals, true)
54 for trial := 1; trial < len(pageSizes); trial++ {
55 c.Check(got[trial], check.DeepEquals, got[0])