From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4CDA741C5DC for ; Fri, 19 Jun 2020 17:01:56 +0300 (MSK) Received: by mail-lj1-f196.google.com with SMTP id s1so11661778ljo.0 for ; Fri, 19 Jun 2020 07:01:56 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) From: =?utf-8?B?0JjQu9GM0Y8g0JrQvtC90Y7RhdC+0LI=?= In-Reply-To: <642b3dbc-98f1-e09a-a71c-f94b8a6091cc@tarantool.org> Date: Fri, 19 Jun 2020 17:01:43 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <7425E178-64A5-4D73-860D-3D5BD0C95CF5@gmail.com> References: <67c75c01-8503-2355-e1f7-9644def2179c@tarantool.org> <6b8b0f63-0a3f-d3ae-7596-2611ea433d44@tarantool.org> <6D02837E-BBEB-4CB9-806F-D5D8E66014B1@gmail.com> <8DEA1673-33E4-4930-9C61-45DEC371FE73@gmail.com> <642b3dbc-98f1-e09a-a71c-f94b8a6091cc@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 2/2] feedback: collect db engines and index features List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.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 = wrote: >=20 > Hi! Thanks for the fixes! >=20 > The patch LGTM except that its test is failing here: > https://travis-ci.org/github/tarantool/tarantool/jobs/699753951 >=20 > Also it fails locally on my machine. >=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > WORKR TEST PARAMS = RESULT > = --------------------------------------------------------------------------= ------- > [001] box-tap/feedback_daemon.test.lua =20= > [001] not ok 15 - failed subtests # =20 > [001] Traceback: > [001] [Lua ] function 'test' at > [001] [main] at = > [001]=20 > [001] {'failed': 2, 'planned': 10} > [001]=20 > [001] not ok 22 - data is equal # =20 > [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,"o= s":"OSX","feedback_type":"version","cluster_id":"26f54eba-e463-4248-82ed-0= 3b1e504ec82","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,"o= s":"OSX","feedback_type":"version","cluster_id":"26f54eba-e463-4248-82ed-0= 3b1e504ec82","tarantool_version":"2.5.0-148-g15a09c910","feedback_version"= :1} > [001] Traceback: > [001] [main] at = > [001]=20 > [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... > = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 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 =20 -test:plan(22) +test:plan(16) =20 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") =20 +daemon.stop() + +actual =3D daemon.generate_feedback() +box.feedback.save("feedback.json") +local fio =3D require("fio") +local fh =3D fio.open("feedback.json") +test:ok(fh, "file is created") +local file_data =3D 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 =3D box.internal.feedback_daemon +daemon.start() +daemon.send_test() +daemon.stop() + -- -- gh-4943: Collect engines and indices statistics. -- =20 -local feedback_json =3D 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 =3D 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 =3D { memtx_spaces =3D 0, vinyl_spaces =3D 0, @@ -132,7 +151,7 @@ local expected =3D { jsonpath_indices =3D 0, functional_indices =3D 0, } -test:is_deeply(feedback_json.features.schema, expected, +test:is_deeply(actual.features.schema, expected, 'schema stats are empty at the moment') =20 box.schema.create_space('features_vinyl', {engine =3D 'vinyl'}) @@ -154,12 +173,8 @@ box.schema.func.create('features_func', { box.space.features_memtx:create_index('j', {parts =3D {{field =3D 1, type =3D 'number'}}, func =3D = 'features_func'}) =20 -check('old feedback received') -feedback_reset() -check('feedback with db features received') - -feedback_json =3D json.decode(feedback_save) -local schema_stats =3D feedback_json.features.schema +actual =3D daemon.generate_feedback() +local schema_stats =3D 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) =20 box.space.features_memtx:create_index('memtx_sec', {type =3D 'hash'}) =20 -check('old feedback received') -feedback_reset() -check('feedback with new db features received') -feedback_json =3D json.decode(feedback_save) -test:is(feedback_json.features.schema.hash_indices, 2, +actual =3D daemon.generate_feedback() +test:is(actual.features.schema.hash_indices, 2, 'internal cache invalidates when schema changes') =20 box.space.features_vinyl:drop() box.space.features_memtx_empty:drop() box.space.features_memtx:drop() =20 -check('old feedback received') -feedback_reset() -check('feedback with new stats received') - -daemon.stop() - -box.feedback.save("feedback.json") -local fio =3D require("fio") -local fh =3D fio.open("feedback.json") -test:ok(fh, "file is created") -local file_data =3D 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 =3D box.internal.feedback_daemon -daemon.start() -daemon.send_test() -daemon.stop() - test:check() os.exit(0)