Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, avtikhon@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] feedback_daemon: fix indexing a nil value issue
Date: Tue, 20 Apr 2021 12:28:57 +0300	[thread overview]
Message-ID: <9824d6f7-c057-17ac-3d2a-645b47d033e5@tarantool.org> (raw)
In-Reply-To: <4e0dd508-1747-1264-95e2-2a32e4b2208c@tarantool.org>



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


  reply	other threads:[~2021-04-20  9:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 17:53 Serge Petrenko via Tarantool-patches
2021-04-19 22:39 ` Vladislav Shpilevoy via Tarantool-patches
2021-04-20  9:28   ` Serge Petrenko via Tarantool-patches [this message]
2021-04-20 19:42     ` Vladislav Shpilevoy via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9824d6f7-c057-17ac-3d2a-645b47d033e5@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] feedback_daemon: fix indexing a nil value issue' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox