Browse Source

Fix time sensitive test

feature/sql-semaphore1
Arnau B 4 years ago
parent
commit
039c7b29da
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      api/api_test.go
  2. +1
    -1
      db/l2db/l2db_test.go

+ 1
- 1
api/api_test.go

@ -191,7 +191,7 @@ func TestMain(m *testing.M) {
// Swagger // Swagger
router := swagger.NewRouter().WithSwaggerFromFile("./swagger.yml") router := swagger.NewRouter().WithSwaggerFromFile("./swagger.yml")
// HistoryDB // HistoryDB
pass := "yourpasswordhere" // os.Getenv("POSTGRES_PASS")
pass := os.Getenv("POSTGRES_PASS")
database, err := db.InitSQLDB(5432, "localhost", "hermez", pass, "hermez") database, err := db.InitSQLDB(5432, "localhost", "hermez", pass, "hermez")
if err != nil { if err != nil {

+ 1
- 1
db/l2db/l2db_test.go

@ -170,7 +170,7 @@ func assertTx(t *testing.T, expected, actual *common.PoolL2Tx) {
token := tokens[expected.TokenID] token := tokens[expected.TokenID]
// If the token has value in USD setted // If the token has value in USD setted
if token.USDUpdate != nil { if token.USDUpdate != nil {
assert.Equal(t, token.USDUpdate.Unix(), actual.AbsoluteFeeUpdate.Unix())
assert.Less(t, token.USDUpdate.Unix()-3, actual.AbsoluteFeeUpdate.Unix())
expected.AbsoluteFeeUpdate = actual.AbsoluteFeeUpdate expected.AbsoluteFeeUpdate = actual.AbsoluteFeeUpdate
// Set expected fee // Set expected fee
f := new(big.Float).SetInt(expected.Amount) f := new(big.Float).SetInt(expected.Amount)

Loading…
Cancel
Save