tarantool / vshard

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

flaky test: router/router.test.lua #366

Closed Serpentian closed 1 year ago

Serpentian commented 1 year ago
router/router.test.lua                                          [ fail ]

Test failed! Result content mismatch:
--- router/router.result    Mon Aug 15 20:19:12 2022
+++ /home/runner/work/vshard/vshard/test/var/rejects/router/router.reject   Mon Aug 15 20:23:24 2022
@@ -498,7 +498,7 @@
 ...
 vshard.router.callro(bucket_id, 'space_get', {'test', {1}})
 ---
-- [1, 1]
+- null
 ...
 vshard.router.callro(bucket_id + 1500, 'space_get', {'test', {1}}) -- nothing
 ---
@@ -618,7 +618,7 @@
 ...
 future:wait_result()
 ---
-- [[1, 1]]
+- []
 ...
 future:is_ready()
 ---
Serpentian commented 1 year ago

It seems like it's related to https://github.com/tarantool/vshard/commit/2500190d11a74b394e424885b3aa156a523c0a7e. The test is not flaky without that commit.

Serpentian commented 1 year ago

Here's the small snippet, using which flakiness can be reproduced:

small_router.test.lua ```lua test_run = require('test_run').new() REPLICASET_1 = { 'storage_1_a', 'storage_1_b' } REPLICASET_2 = { 'storage_2_a', 'storage_2_b' } test_run:create_cluster(REPLICASET_1, 'router') test_run:create_cluster(REPLICASET_2, 'router') util = require('util') util.wait_master(test_run, REPLICASET_1, 'storage_1_a') util.wait_master(test_run, REPLICASET_2, 'storage_2_a') util.map_evals(test_run, {REPLICASET_1, REPLICASET_2}, 'bootstrap_storage(\'memtx\')') util.push_rs_filters(test_run) _ = test_run:cmd("create server router_1 with script='router/router_1.lua'") _ = test_run:cmd("start server router_1 with args='discovery_disable'") _ = test_run:switch("router_1") util = require('util') -- -- Initial distribution -- util.check_error(vshard.router.call, 1, 'read', 'echo', {123}) vshard.router.bootstrap({timeout = 5}) vshard.router.cfg(cfg) _ = test_run:cmd('stop server storage_2_a') util.check_error(vshard.router.call, 1, 'read', 'echo', {123}) _ = test_run:cmd('start server storage_2_a') fiber.sleep(0.05) -- -- gh-69: aliases for router.call - callro and callrw. -- bucket_id = 1 vshard.router.callrw(bucket_id, 'space_insert', {'test', {1, bucket_id}}) vshard.router.callrw(bucket_id, 'vshard.storage.sync', {}) vshard.router.callro(bucket_id, 'space_get', {'test', {1}}) _ = test_run:switch("default") test_run:drop_cluster(REPLICASET_2) _ = test_run:cmd("stop server router_1") _ = test_run:cmd("cleanup server router_1") test_run:drop_cluster(REPLICASET_1) _ = test_run:cmd('clear filter') ```