Skip to content

Commit

Permalink
exp/ticker: fix db tests that would sporadically break due to roundin…
Browse files Browse the repository at this point in the history
…g issues (#1267)
  • Loading branch information
accordeiro authored May 10, 2019
1 parent 09930b8 commit 4a5fd62
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions exp/ticker/internal/tickerdb/queries_asset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,8 @@ func TestInsertOrUpdateAsset(t *testing.T) {
assert.Equal(t, code, dbAsset2.Code)
assert.Equal(t, issuerAccount, dbAsset1.IssuerAccount)
assert.Equal(t, dbIssuer.ID, dbAsset2.IssuerID)
assert.NotEqual(
t,
firstTime.Local().Truncate(time.Millisecond),
dbAsset2.LastValid.Local().Truncate(time.Millisecond),
)
assert.NotEqual(t,
firstTime.Local().Truncate(time.Millisecond),
dbAsset2.LastChecked.Local().Truncate(time.Millisecond),
)
assert.True(t, dbAsset2.LastValid.After(firstTime))
assert.True(t, dbAsset2.LastChecked.After(firstTime))
assert.Equal(
t,
secondTime.Local().Truncate(time.Millisecond),
Expand Down Expand Up @@ -145,16 +138,8 @@ func TestInsertOrUpdateAsset(t *testing.T) {
assert.Equal(t, code, dbAsset3.Code)
assert.Equal(t, issuerAccount, dbAsset3.IssuerAccount)
assert.Equal(t, dbIssuer.ID, dbAsset3.IssuerID)
assert.NotEqual(
t,
thirdTime.Local().Truncate(time.Millisecond),
dbAsset3.LastValid.Local().Truncate(time.Millisecond),
)
assert.NotEqual(
t,
thirdTime.Local().Truncate(time.Millisecond),
dbAsset3.LastChecked.Local().Truncate(time.Millisecond),
)
assert.True(t, dbAsset3.LastValid.Before(thirdTime))
assert.True(t, dbAsset3.LastChecked.Before(thirdTime))
assert.Equal(
t,
dbAsset2.LastValid.Local().Truncate(time.Millisecond),
Expand Down

0 comments on commit 4a5fd62

Please sign in to comment.