Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
(#256).
- The `utubettl` driver could accumulate tasks in the status `READY` without
deleting (#261).
- `queue._VERSION` was `nil` if the module was loaded on an instance that was
already in read-write mode (#260).

## [1.5.0] - 2026-07-10

Expand Down
3 changes: 2 additions & 1 deletion queue/abstract.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ local queue = {
return not (self[tube_name] == nil)
end
}),
stat = {}
stat = {},
_VERSION = require('queue.version'),
}

-- Release tasks that don't have session_uuid stored in inactive sessions.
Expand Down
2 changes: 1 addition & 1 deletion queue/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ queue = setmetatable({
register_driver = register_driver,
state = queue_state.show,
cfg = deferred_cfg,
_VERSION = require('queue.version'),
_VERSION = abstract._VERSION,
}, { __index = function(self, key)
-- In replicaset mode, the user can attempt to call public methods on the replica start.
-- For example, a single script is used for master and replica.
Expand Down
6 changes: 4 additions & 2 deletions t/000-init.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ local queue = require('queue')
local engine = os.getenv('ENGINE') or 'memtx'

test:test('access to queue until box.cfg is started', function(test)
test:plan(3)
test:plan(4)
test:isnil(rawget(box, 'space'), 'box is not started yet')
test:is(queue._VERSION, require('queue.version'), 'queue._VERSION')

local s, e = pcall(function() return queue.tube end)
test:ok(not s, 'exception was generated')
Expand All @@ -24,7 +25,8 @@ local tnt = require('t.tnt')
tnt.cfg{}

test:test('access to queue after box.cfg{}', function(test)
test:plan(9)
test:plan(10)
test:is(queue._VERSION, require('queue.version'), 'queue._VERSION')
test:istable(queue.tube, 'queue.tube is table')
test:is(#queue.tube, 0, 'queue.tube is empty')

Expand Down
18 changes: 18 additions & 0 deletions t/270-version.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env tarantool
local tap = require('tap')
local tnt = require('t.tnt')

local test = tap.test('module version')
test:plan(1)

-- The instance is writable before the module is loaded, so the queue
-- starts at once, without the "lazy start".
tnt.cfg{}
local queue = require('queue')

test:is(queue._VERSION, require('queue.version'),
'queue._VERSION after start on a writable instance')

tnt.finish()
os.exit(test:check() and 0 or 1)
-- vim: set ft=lua :
Loading