From: "Илья Конюхов" <runsfor@gmail.com> To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH 2/2] feedback: collect db engines and index features Date: Fri, 19 Jun 2020 17:01:43 +0300 [thread overview] Message-ID: <7425E178-64A5-4D73-860D-3D5BD0C95CF5@gmail.com> (raw) In-Reply-To: <642b3dbc-98f1-e09a-a71c-f94b8a6091cc@tarantool.org> Hi, Got it. That was a flaky test, which was failed on busy host. Fixed by gathering feedback synchronously. > On 19 Jun 2020, at 02:02, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote: > > Hi! Thanks for the fixes! > > The patch LGTM except that its test is failing here: > https://travis-ci.org/github/tarantool/tarantool/jobs/699753951 > > Also it fails locally on my machine. > > ====================================================================================== > WORKR TEST PARAMS RESULT > --------------------------------------------------------------------------------- > [001] box-tap/feedback_daemon.test.lua > [001] not ok 15 - failed subtests # > [001] Traceback: > [001] [Lua ] function 'test' at <builtin/tap.lua:249> > [001] [main] at </Users/gerold/Work/Repositories/tarantool/test/box-tap/feedback_daemon.test.lua:0> > [001] > [001] {'failed': 2, 'planned': 10} > [001] > [001] not ok 22 - data is equal # > [001] Expected: {"arch":"x64","features":{"schema":{"local_spaces":1,"functional_indices":0,"hash_indices":1,"rtree_indices":0,"temporary_spaces":1,"tree_indices":1,"jsonpath_indices":0,"vinyl_spaces":0,"bitset_indices":1,"memtx_spaces":1}},"server_id":"fb2c934e-e20e-44c3-824d-2ee854863569","is_docker":false,"os":"OSX","feedback_type":"version","cluster_id":"26f54eba-e463-4248-82ed-03b1e504ec82","tarantool_version":"2.5.0-148-g15a09c910","feedback_version":1} > [001] Got: {"arch":"x64","features":{"schema":{"local_spaces":0,"functional_indices":0,"hash_indices":0,"rtree_indices":0,"temporary_spaces":0,"tree_indices":0,"jsonpath_indices":0,"vinyl_spaces":0,"bitset_indices":0,"memtx_spaces":0}},"server_id":"fb2c934e-e20e-44c3-824d-2ee854863569","is_docker":false,"os":"OSX","feedback_type":"version","cluster_id":"26f54eba-e463-4248-82ed-03b1e504ec82","tarantool_version":"2.5.0-148-g15a09c910","feedback_version":1} > [001] Traceback: > [001] [main] at </Users/gerold/Work/Repositories/tarantool/test/box-tap/feedback_daemon.test.lua:0> > [001] > [001] Rejected result file: box-tap/feedback_daemon.reject > [001] [ fail ] > [Main process] Got failed test; gently terminate all workers... > [001] Worker "001_box-tap" got failed test; stopping the server... > ———————————————————————————————————————— diff --git a/test/box-tap/feedback_daemon.test.lua b/test/box-tap/feedback_daemon.test.lua index d5c0eacab..1fd5778b4 100755 --- a/test/box-tap/feedback_daemon.test.lua +++ b/test/box-tap/feedback_daemon.test.lua @@ -67,7 +67,7 @@ if not ok then os.exit(0) end -test:plan(22) +test:plan(16) local function check(message) while feedback_count < 1 do @@ -113,13 +113,32 @@ check("feedback after start") daemon.send_test() check("feedback after feedback send_test") +daemon.stop() + +actual = daemon.generate_feedback() +box.feedback.save("feedback.json") +local fio = require("fio") +local fh = fio.open("feedback.json") +test:ok(fh, "file is created") +local file_data = fh:read() +test:is(file_data, json.encode(actual), "data is equal") +fh:close() +fio.unlink("feedback.json") + +server:close() +-- check it does not fail without server +daemon = box.internal.feedback_daemon +daemon.start() +daemon.send_test() +daemon.stop() + -- -- gh-4943: Collect engines and indices statistics. -- -local feedback_json = json.decode(feedback_save) -test:is(type(feedback_json.features), 'table', 'features field is present') -test:is(type(feedback_json.features.schema), 'table', 'schema stats are present') +local actual = daemon.generate_feedback() +test:is(type(actual.features), 'table', 'features field is present') +test:is(type(actual.features.schema), 'table', 'schema stats are present') local expected = { memtx_spaces = 0, vinyl_spaces = 0, @@ -132,7 +151,7 @@ local expected = { jsonpath_indices = 0, functional_indices = 0, } -test:is_deeply(feedback_json.features.schema, expected, +test:is_deeply(actual.features.schema, expected, 'schema stats are empty at the moment') box.schema.create_space('features_vinyl', {engine = 'vinyl'}) @@ -154,12 +173,8 @@ box.schema.func.create('features_func', { box.space.features_memtx:create_index('j', {parts = {{field = 1, type = 'number'}}, func = 'features_func'}) -check('old feedback received') -feedback_reset() -check('feedback with db features received') - -feedback_json = json.decode(feedback_save) -local schema_stats = feedback_json.features.schema +actual = daemon.generate_feedback() +local schema_stats = actual.features.schema test:test('features.schema', function(t) t:plan(10) t:is(schema_stats.memtx_spaces, 2, 'memtx engine usage gathered') @@ -176,38 +191,13 @@ end) box.space.features_memtx:create_index('memtx_sec', {type = 'hash'}) -check('old feedback received') -feedback_reset() -check('feedback with new db features received') -feedback_json = json.decode(feedback_save) -test:is(feedback_json.features.schema.hash_indices, 2, +actual = daemon.generate_feedback() +test:is(actual.features.schema.hash_indices, 2, 'internal cache invalidates when schema changes') box.space.features_vinyl:drop() box.space.features_memtx_empty:drop() box.space.features_memtx:drop() -check('old feedback received') -feedback_reset() -check('feedback with new stats received') - -daemon.stop() - -box.feedback.save("feedback.json") -local fio = require("fio") -local fh = fio.open("feedback.json") -test:ok(fh, "file is created") -local file_data = fh:read() -test:is(file_data, feedback_save, "data is equal") -fh:close() -fio.unlink("feedback.json") - -server:close() --- check it does not fail without server -local daemon = box.internal.feedback_daemon -daemon.start() -daemon.send_test() -daemon.stop() - test:check() os.exit(0)
next prev parent reply other threads:[~2020-06-19 14:01 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-05 8:35 [Tarantool-patches] [PATCH 0/2] Extend feedback module report Ilya Konyukhov 2020-06-05 8:35 ` [Tarantool-patches] [PATCH 1/2] feedback: determine runtime platform info Ilya Konyukhov 2020-06-07 16:45 ` Vladislav Shpilevoy 2020-06-09 23:05 ` Илья Конюхов 2020-06-11 19:32 ` Vladislav Shpilevoy 2020-07-01 0:16 ` Alexander Turenko 2020-07-05 2:14 ` Alexander Turenko 2020-06-05 8:35 ` [Tarantool-patches] [PATCH 2/2] feedback: collect db engines and index features Ilya Konyukhov 2020-06-07 16:45 ` Vladislav Shpilevoy 2020-06-09 23:06 ` Илья Конюхов 2020-06-11 19:32 ` Vladislav Shpilevoy 2020-06-17 8:59 ` Илья Конюхов 2020-06-17 22:53 ` Vladislav Shpilevoy 2020-06-18 15:42 ` Илья Конюхов 2020-06-18 23:02 ` Vladislav Shpilevoy 2020-06-19 14:01 ` Илья Конюхов [this message] 2020-06-19 23:49 ` Vladislav Shpilevoy 2020-06-22 8:55 ` Илья Конюхов 2020-07-01 0:15 ` Alexander Turenko 2020-07-03 12:05 ` Илья Конюхов 2020-07-05 2:10 ` Alexander Turenko 2020-06-23 21:23 ` [Tarantool-patches] [PATCH 0/2] Extend feedback module report Vladislav Shpilevoy 2020-07-13 13:47 ` Kirill Yukhin
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=7425E178-64A5-4D73-860D-3D5BD0C95CF5@gmail.com \ --to=runsfor@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 2/2] feedback: collect db engines and index features' \ /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