Skip to content

Commit

Permalink
Fix randomized map bug in xignite feeder test (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Notargets authored Jun 21, 2019
1 parent a5e0d91 commit 4811cc6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
14 changes: 11 additions & 3 deletions contrib/xignitefeeder/writer/quotes_writer_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package writer

import (
"github.com/alpacahq/marketstore/contrib/xignitefeeder/internal"
"github.com/alpacahq/marketstore/utils/io"
"sort"
"testing"
"time"

"github.com/alpacahq/marketstore/contrib/xignitefeeder/internal"
"github.com/alpacahq/marketstore/utils/io"

"github.com/alpacahq/marketstore/contrib/xignitefeeder/api"
)

Expand Down Expand Up @@ -72,7 +74,13 @@ func TestQuotesWriterImpl_Write(t *testing.T) {
}

// Time Bucket Key Name check
timeBucketKeyStr := string(m.WrittenCSM.GetMetadataKeys()[0].Key)
keys := m.WrittenCSM.GetMetadataKeys()
keyStrings := make([]string, len(keys))
for i, key := range keys {
keyStrings[i] = string(key.Key)
}
sort.Strings(keyStrings)
timeBucketKeyStr := keyStrings[0]
if timeBucketKeyStr != "1234/1Sec/TICK:"+io.DefaultTimeBucketSchema {
t.Errorf("TimeBucketKey for the first data is invalid. got=%v, want = %v",
timeBucketKeyStr, "1234/1Sec/TICK:"+io.DefaultTimeBucketSchema)
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
github.com/jessevdk/go-flags v1.4.0
github.com/json-iterator/go v1.1.6
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/kataras/golog v0.0.0-20190620222301-4851375e24d4 // indirect
github.com/kataras/iris v11.1.0+incompatible // indirect
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d // indirect
github.com/klauspost/compress v1.4.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQ
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
github.com/kataras/golog v0.0.0-20180321173939-03be10146386 h1:VT6AeCHO/mc+VedKBMhoqb5eAK8B1i9F6nZl7EGlHvA=
github.com/kataras/golog v0.0.0-20180321173939-03be10146386/go.mod h1:PcaEvfvhGsqwXZ6S3CgCbmjcp+4UDUh2MIfF2ZEul8M=
github.com/kataras/golog v0.0.0-20190620222301-4851375e24d4 h1:ZB58CeszFQ8AeNEOsa/sV5Vd5Cs9EVExSCJEJz2/y/0=
github.com/kataras/golog v0.0.0-20190620222301-4851375e24d4/go.mod h1:PcaEvfvhGsqwXZ6S3CgCbmjcp+4UDUh2MIfF2ZEul8M=
github.com/kataras/iris v0.0.0-20181106020650-c20bc3bceef1 h1:X1yjoGt3Aa3aNc9Q9ovQdmWyidGq6sD8Jw2EHPFrv6s=
github.com/kataras/iris v0.0.0-20181106020650-c20bc3bceef1/go.mod h1:4cangdWZW4brINuhSqxUwRwwObNAwvqkQm3EcRDL5pA=
github.com/kataras/iris v11.1.0+incompatible h1:hRCQxJTg2+sOmgK7+TUJKy27qL1L+UYWqMbbfjVCKnA=
Expand Down

0 comments on commit 4811cc6

Please sign in to comment.