[Tarantool-patches] [PATCH] feedback_daemon: fix indexing a nil value issue

Serge Petrenko sergepetrenko at tarantool.org
Tue Apr 20 12:28:57 MSK 2021



20.04.2021 01:39, Vladislav Shpilevoy пишет:
> Thanks for the patch!
>
> For bugfixes we usually add a test. Looks fine except that.
> But I didn't validate (because no a test).
Thanks for the review!

Here's  the test:

===========================

diff --git a/test/box-tap/gh-5750-feedback-disabled-err.test.lua 
b/test/box-tap/gh-5750-feedback-disabled-err.test.lua
new file mode 100755
index 000000000..190e93b7d
--- /dev/null
+++ b/test/box-tap/gh-5750-feedback-disabled-err.test.lua
@@ -0,0 +1,29 @@
+#!/usr/bin/env tarantool
+
+--
+-- Test that disabling feedback in initial configuration doesn't lead to
+-- "attempt to index field 'cached_events' (a nil value)" errors when 
creating
+-- or dropping a space/index.
+--
+
+local tap = require('tap')
+local test = tap.test('feedback_enabled=false')
+
+local ok, err = pcall(box.cfg, {feedback_enabled=false})
+
+-- feedback daemon may be disabled at compile time. Then all options like
+-- feedback_enabled will be undefined.
+if not ok then
+    test:plan(1)
+    test:like(err, 'unexpected option', 'feedback_enabled is undefined')
+    test:check()
+    os.exit(0)
+end
+
+test:plan(2)
+ok = pcall(box.schema.space.create, 'test')
+test:ok(ok, 'space create succeeds')
+ok = pcall(box.space.test.drop, box.space.test)
+test:ok(ok, 'space drop succeeds')
+test:check()
+os.exit(0)

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list