Skip to content

Commit

Permalink
tests(dao) fix DAO testss erroring with Cassandra
Browse files Browse the repository at this point in the history
We need to flush the shm after it stores C* nodes as being down due to
intentional failure to connect to it.
  • Loading branch information
thibaultcha committed Feb 3, 2017
1 parent 38d590f commit 27059d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/02-integration/02-dao/02-migrations_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ helpers.for_each_dao(function(kong_config)
local f = Factory(kong_config)
f:drop_schema()
end)

teardown(function()
ngx.shared.cassandra:flush_expired()
end)

before_each(function()
factory = Factory(kong_config)
end)
Expand Down Expand Up @@ -105,6 +110,7 @@ helpers.for_each_dao(function(kong_config)
kong_config.pg_port = pg_port
kong_config.cassandra_port = cassandra_port
kong_config.cassandra_timeout = cassandra_timeout
ngx.shared.cassandra:flush_all()
end)
kong_config.pg_port = 3333
kong_config.cassandra_port = 3333
Expand Down
2 changes: 2 additions & 0 deletions spec/02-integration/02-dao/03-crud_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ helpers.for_each_dao(function(kong_config)
end)
teardown(function()
factory:truncate_tables()
ngx.shared.cassandra:flush_expired()
end)

describe("insert()", function()
Expand Down Expand Up @@ -701,6 +702,7 @@ helpers.for_each_dao(function(kong_config)
kong_config.pg_port = pg_port
kong_config.cassandra_port = cassandra_port
kong_config.cassandra_timeout = cassandra_timeout
ngx.shared.cassandra:flush_all()
end)
kong_config.pg_port = 3333
kong_config.cassandra_port = 3333
Expand Down

0 comments on commit 27059d4

Please sign in to comment.