tarantool / vshard

The new generation of sharding based on virtual buckets
Other
100 stars 31 forks source link

test: fix flaky storage/storage.test.lua #419

Closed Serpentian closed 1 year ago

Serpentian commented 1 year ago

Currently the test sometimes fails with panic on cfg_get('read_only'). It's caused by emulating of unconfigured box, which is done by making box.cfg a function.

Here's what happens: we restart instance storage_1_a and emulate unconfigured box there. Instance storage_1_b didn't managed to connect for replication before this point, so it sends IPROTO_VOTE on applier connection. storage_1_a's box.cfg is a function, so getting 'read_only' option from it fails.

Let's fix that by using wait_master() function, which waits for all upstreams to have 'follow' mode. IPROTO_VOTE is sent (maybe not once) only during replicaset boostrap (after connection of the applier, but before IPROTO_SUBSCRIBE). Using wait_master() function will help us to be sure, that IPROTO_VOTE won't come while we emulate unconfigured box.

Closes #335

NO_DOC=testfix