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

tarantool / expirationd / 4952725597

pending completion
4952725597

push

github

GitHub
Merge bb75fa0dc into 61b6dca5c

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

5728 of 6018 relevant lines covered (95.18%)

10.95 hits per line

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

97.78
/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
    local tasks = {}
3✔
35
    for i = 1, tasks_cnt do
15✔
36
        table.insert(tasks, expirationd.start("test" .. i, space.id, helpers.is_expired_true))
24✔
37
    end
38

39
    local old_expd = expirationd
3✔
40

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

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

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

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

65
    for i = 1, tasks_cnt do
15✔
66
        tasks[i]:kill()
12✔
67
        expirationd.kill("test" .. i)
12✔
68
    end
69
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