Commit 52d261f
committed
test: fix router-luatest/reload_test not reloading vshard
Before this commit the test loaded only the latest version, so the test
ran 2 times on the latest commit and did not test the actual hot-reload.
It tried to start the router on the latest version, changed
`package.loaded` and that's it, `vshard.router` even wasn't required
after that.
Since we don't support hot-reload from new version to the old one (see
0.1.34 release notes), let's actually create the router on old version
from the first start and then reload it to the latest. For that let's
use `LUA_PATH` environment variable. The alternative of using
`package.path` was rejected, since it requires modifying
`instances/router.lua` file.
However, changing `LUA_PATH` so that it points to `vshard_copy`
directory is not enough. The test runs from the repository directory and
`cwd` has higher priority, than `package.path` (which is set to
`LUA_PATH`). To bypass that, let's move the vshard copy to the
`override` directory, it has priority over `cwd`.
This commit also replaces all usages of `vtest.router_cfg` with local
function, since `ivtest.clear_test_cfg_options` may not present on old
version.
We also need to wait for service to be stopped before running the test
after reload during master_search service. The alternative solution is
using `router.master_search_f` to determine on which version function
is running. It's nullified right on reload. But let's better test, that
old services are actually stopped as soon as they're not needed.
Closes tarantool/vshard-ee#11
Co-authored-by: Roman Gromov <r.gromov.official@gmail.com>
NO_DOC=testfix1 parent 0fd3693 commit 52d261f
File tree
2 files changed
+57
-19
lines changed- test
- luatest_helpers
- router-luatest
2 files changed
+57
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
| 659 | + | |
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
663 | | - | |
664 | | - | |
665 | | - | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
35 | 56 | | |
36 | 57 | | |
37 | 58 | | |
| |||
71 | 92 | | |
72 | 93 | | |
73 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
74 | 105 | | |
75 | 106 | | |
76 | 107 | | |
| |||
83 | 114 | | |
84 | 115 | | |
85 | 116 | | |
86 | | - | |
87 | 117 | | |
88 | 118 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
101 | 128 | | |
102 | 129 | | |
103 | 130 | | |
| |||
196 | 223 | | |
197 | 224 | | |
198 | 225 | | |
199 | | - | |
| 226 | + | |
200 | 227 | | |
201 | 228 | | |
202 | 229 | | |
| |||
288 | 315 | | |
289 | 316 | | |
290 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
291 | 329 | | |
292 | 330 | | |
293 | 331 | | |
0 commit comments