Skip to content

Commit

Permalink
test: fix hang in storage/recovery.test
Browse files Browse the repository at this point in the history
The problem is that recovery fiber wakes up earlier than we want it
to do so. This leads to the test output which we don't expect.

Let's block recovery fiber before making any changes to the `_bucket`.
It'll start again as soon as the instance is restarted.

Needed for tarantool#341
  • Loading branch information
Serpentian committed Aug 11, 2022
1 parent e0289bf commit 3b3a909
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/storage/recovery.result
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ while _bucket:count() ~= 2 do vshard.storage.recovery_wakeup() fiber.sleep(0.1)
_ = test_run:switch('storage_1_a')
---
...
vshard.storage.internal.errinj.ERRINJ_RECOVERY_PAUSE = true
---
...
_bucket:replace{1, vshard.consts.BUCKET.SENDING, util.replicasets[2]}
---
- [1, 'sending', '<replicaset_2>']
Expand Down
1 change: 1 addition & 0 deletions test/storage/recovery.test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ while _bucket:count() ~= 2 do vshard.storage.recovery_wakeup() fiber.sleep(0.1)
-- must restore buckets, when the destination is up.
--
_ = test_run:switch('storage_1_a')
vshard.storage.internal.errinj.ERRINJ_RECOVERY_PAUSE = true
_bucket:replace{1, vshard.consts.BUCKET.SENDING, util.replicasets[2]}
_ = test_run:switch('storage_2_a')
_bucket:replace{1, vshard.consts.BUCKET.ACTIVE}
Expand Down

0 comments on commit 3b3a909

Please sign in to comment.