Skip to content

Commit

Permalink
Fix broken disk_failure_test
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvar-antonsson committed Jul 3, 2024
1 parent f801b43 commit d4ad849
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/integration/disk_failure_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ g.before_all(function()
datadir = fio.tempdir(),
server_command = helpers.entrypoint('srv_basic'),
cookie = helpers.random_cookie(),
use_vshard = true,
replicasets = { {
alias = 'router',
roles = {'vshard-router'},
Expand Down Expand Up @@ -46,10 +47,12 @@ function g.test_disk_failure_disable()

-- first DC disk is down
sharded_storage_1:exec(function()
package.loaded.fio.lstat = function () return false end
rawset(_G, 'old_lstat', package.loaded.fio.lstat)
package.loaded.fio.lstat = function () return nil end
end)
simple_storage_1:exec(function()
package.loaded.fio.lstat = function () return false end
rawset(_G, 'old_lstat', package.loaded.fio.lstat)
package.loaded.fio.lstat = function () return nil end
end)

-- check disabled instances
Expand Down Expand Up @@ -122,10 +125,10 @@ function g.test_disk_failure_disable()

-- first DC disk is alright
sharded_storage_1:exec(function()
package.loaded.fio.lstat = function() return true end
package.loaded.fio.lstat = _G.old_lstat
end)
simple_storage_1:exec(function()
package.loaded.fio.lstat = function() return true end
package.loaded.fio.lstat = _G.old_lstat
end)

-- enable it back
Expand Down

0 comments on commit d4ad849

Please sign in to comment.