• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / expirationd / 4952650086

pending completion
4952650086

push

github

GitHub
Merge 18a516132 into 61b6dca5c

43 of 43 new or added lines in 1 file covered. (100.0%)

5724 of 6014 relevant lines covered (95.18%)

10.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.67
/test/unit/update_and_kill_test.lua
1
local expirationd = require("expirationd")
1✔
2
local fiber = require("fiber")
1✔
3
local t = require("luatest")
1✔
4

5
local helpers = require("test.helper")
1✔
6

7
local g = t.group('update_and_kill', {
2✔
8
    {index_type = 'TREE', engine = 'vinyl'},
1✔
9
    {index_type = 'TREE', engine = 'memtx'},
1✔
10
    {index_type = 'HASH', engine = 'memtx'},
1✔
11
})
12

13
g.before_each({index_type = 'TREE'}, function(cg)
2✔
14
    t.skip_if(cg.params.engine == 'vinyl' and not helpers.vinyl_is_supported(),
5✔
15
        'Blocked by https://github.com/tarantool/tarantool/issues/6448')
2✔
16
    cg.space = helpers.create_space_with_tree_index(cg.params.engine)
4✔
17
end)
18

19
g.before_each({index_type = 'HASH'}, function(cg)
2✔
20
    cg.space = helpers.create_space_with_hash_index(cg.params.engine)
2✔
21
end)
22

23
g.after_each(function(cg)
2✔
24
    if cg.task ~= nil then
3✔
25
        cg.task:kill()
×
26
    end
27
    cg.space:drop()
3✔
28
end)
29

30
function g.test_expirationd_update(cg)
1✔
31
    local space = cg.space
3✔
32

33
    local tasks_cnt = 4
3✔
34
    for i = 1, tasks_cnt do
15✔
35
        expirationd.start("test" .. i, space.id, helpers.is_expired_true)
12✔
36
    end
37

38
    local old_expd = expirationd
3✔
39

40
    local chan = fiber.channel(1)
3✔
41
    fiber.create(function()
6✔
42
        expirationd.update()
3✔
43
        chan:put(1)
3✔
44
    end)
45
    local _, err = pcall(function() expirationd.start() end)
6✔
46
    t.assert_str_contains(err, "Wait until update is done")
3✔
47
    chan:get()
3✔
48

49
    expirationd = require("expirationd")
3✔
50
    t.assert_not_equals(
6✔
51
        tostring(old_expd):match("0x.*"),
3✔
52
        tostring(expirationd):match("0x.*"))
3✔
53

54
    local total = 10
3✔
55
    for i = 1, total do
33✔
56
        space:insert({i, tostring(i)})
30✔
57
    end
58

59
    t.assert_equals(space:count(), total)
4✔
60
    helpers.retrying({}, function()
6✔
61
        t.assert_equals(space:count(), 0)
44✔
62
    end)
63

64
    for i = 1, tasks_cnt do
15✔
65
        expirationd.kill("test" .. i)
12✔
66
    end
67
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc