-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: check hotreload #49
Conversation
0448c89
to
e4d7977
Compare
9087d91
to
6c7ff79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes must be validated with @Totktonada
df402a8
to
fae1f29
Compare
test/integration/hotreload_test.lua
Outdated
@@ -0,0 +1,98 @@ | |||
local fio = require('fio') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What property of expirationd you verify here? I don't understand how all this code is relevant to expirationd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a well defined hypothesis about a class of problems we can catch this way (plus understanding why we can't do it in a more obvious and simple way) to actually add and support this testing code within the expirationd repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, take me right: I encourage using of smart testing techniques, where usual unit / functional testing are not powerful enough. Say, when a functional testing is able to catch particular set of highly specialized problems, but well implemented integration testing is able to catch almost any problem of given class. Or, say, the typical situation, when a functional testing unable to catch a real world problem, which only appears with data from a previous version of a module / an application.
I understand what cartridge/hotreload.lua doing (as well as moonlibs/module-reload). But I still don't catch the idea of this test. The questions that I ask for myself are:
-
What is the class of problems it should catch?
-
Whether it is beyond the class of problems that will be catched by the following code:
local expirationd = require('expirationd') <..create a space..> <..fill the space..> expirationd.start(<...>) <..check all tuples are expired..> expirationd.kill(<...>) <..fill the space..> <..check that tuples are not expiring..> package.loaded.expirationd = nil expirationd = require('expirationd') expirationd.start(<...>) <..check all tuples are expired..>
-
Even more, whether it is beyoud problems we able to catch this way:
require('expirationd') package.loaded.expirationd = nil require('expirationd')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case, @no1seman asked to make a test, which will clearly show that when call require("cartridge.roles").reload(), correct processing of the expirationd module is possible
b5d8ae3
to
eecd305
Compare
If force is not specified, then it is now false by default, which is indicated in the description. Before that, if force was not specified, then it was correspondingly nil, which worked great, but was confusing when it was impossible to find the force field in the task table
1fb2066
to
49ed6aa
Compare
3b2a9ae
to
d546b79
Compare
bca2c58
to
5575583
Compare
The class of problems that this test catches is the expirationd integration with cartridge. When hot-reloading roles (that is, when call require("cartridge.roles").reload() ), expirationd should exit gracefully. All fibers should terminate and the task list should be cleared. Also added cartridge rock to ci. Bump luatest cause bug with before_suite. Closes #54
The class of problems that this test catches is the expirationd integration with cartridge. When hot-reloading roles (that is, when call require("cartridge.roles").reload() ), expirationd should exit gracefully. All fibers should terminate and the task list should be cleared.
These tests will also be used as an example of using hot reload and expirationd
tests:
Closes #54