Skip to content

Commit

Permalink
[Blockstore] fix test_disable_io_for_broken_devices (#2793)
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Misko <[email protected]>
  • Loading branch information
sharpeye and Pavel Misko authored Jan 3, 2025
1 parent b46dac0 commit b7f9431
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions cloud/blockstore/tests/disk_agent_config/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ def _add_host(client, agent_id):
return client.cms_action(request)


# wait for devices to be cleared
def _wait_devices(client):
while True:
bkp = _backup(client)
if bkp.get("DirtyDevices", 0) == 0:
break
time.sleep(1)


def test_change_rack(nbs, agent_ids, disk_agent_configurators):

client = CreateClient(f"localhost:{nbs.port}")
Expand All @@ -190,12 +199,7 @@ def test_change_rack(nbs, agent_ids, disk_agent_configurators):
assert d.get('State') is None # online
assert d['Rack'] == 'c:RACK' # default rack

# wait for devices to be cleared
while True:
bkp = _backup(client)
if bkp.get("DirtyDevices", 0) == 0:
break
time.sleep(1)
_wait_devices(client)

# create volumes

Expand Down Expand Up @@ -270,12 +274,7 @@ def test_null_backend(nbs, agent_ids, disk_agent_configurators):
assert len(r.ActionResults) == 1
assert r.ActionResults[0].Result.Code == 0

# wait for devices to be cleared
while True:
bkp = _backup(client)
if bkp.get("DirtyDevices", 0) == 0:
break
time.sleep(1)
_wait_devices(client)

client.create_volume(
disk_id="vol1",
Expand Down Expand Up @@ -352,6 +351,8 @@ def test_disable_io_for_broken_devices(
assert len(r.ActionResults) == 1
assert r.ActionResults[0].Result.Code == 0

_wait_devices(client)

# create a volume
client.create_volume(
disk_id="vol1",
Expand Down

0 comments on commit b7f9431

Please sign in to comment.