From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 02F2FEBF9E0; Tue, 4 Feb 2025 13:07:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 02F2FEBF9E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1738663670; bh=TbTiyrfdGRLCjAoRUI2lkOnw/RWox+8bVUJOqAxsnp0=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gOMNPzQpiGiQ+JJjkzcMjyV/EIalSkBKfCiyNi9d8Hhk3Xz8xYtDs22VxxWKkqNpR oX2lLukkfANQse8//I0selx6Ve9hNugMzhtrQ8ztEfVKokAJ9Po0Y0nqxdkllnt7QK PbQRzG/pAx6E3puDRzgX0lzEpHdYGhpEkeVtVX5E= Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E4EB1EBF9DD for ; Tue, 4 Feb 2025 13:07:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E4EB1EBF9DD Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-ab751a7f67bso37835866b.1 for ; Tue, 04 Feb 2025 02:07:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738663645; x=1739268445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9JjfOTydZ4J0vO360uFEOySO4S9wbrOgoOfkNJW8o8I=; b=Vto9ke25flu1+W9smLCEsBXI0RpnLkhN6KdxPc8eIgGbgxIntlVsbLRmHtMX0rmN4g bCqSWJe4f1i24w2+Utmdxx71guKxsjbLY9mSvbLae/PJdP74nqwJ7UT1LvYyR36d/eEO kgm/EI2BXw2bMOINHSGR5l9TolQVr3P5qerRYz+SlBj4WHnJmt/ksEfaIge8Z5KIVWqE xJoarnFIKrJi2qxFp4I6v4QBy0RvRgw2kK+T7l+OT/l484CSROePhyti2cDo1u9v94Ar VE6lRLfZSCZy58YRLrB3tWHOaG3znVO33iYwHA7hMJ1iVf2w9U2bsAtECpJfdHu5pWPL waoA== X-Gm-Message-State: AOJu0YxO3No+8LzDp4bdaOmbqOZRwIJx+EFNIvHpNhowkSQdUFKGEjwS yNKZ4es38Ho/gm5esCv0MMPFNOXhMDCbNCuNjRgYNnqigcIBSvmqzRL65RNI X-Gm-Gg: ASbGncskVLcV6blIkAbQYTyxlw4j66BZMu+mioYG6BsoMuLNGOpY8Rdfc5YYvGvb1F0 CtJJQeXWIZGNPB9yIlL5Gv1J48XR2k/J+eAHMZRd4gMr8D+23eKM6v8Dc2N0JuvgRP5bK4AdfCH ssnU/Cu5AYOnQaJ4hYzRXwi+MFmOu1kw2BRxV+nzA7OFI5VE+9Pp5NiEy+/CoAZhFNOnjIBczO3 FJhGvNI6NQRey+VcLZJ0TLl/HpSsTlCMKkbDYUFwfk+iADwTlnu/QxGicXE7pYLs2P/QbkjC8yu 0ZcJvA== X-Google-Smtp-Source: AGHT+IGa3Hj0NElxEqaDM/8Y8vVpLXVRzJS68w/qTiMDIAlPvCQMVb8B5UX77Wj+gzlvtOyxearfQg== X-Received: by 2002:a17:907:d25:b0:aa6:7ec4:8bac with SMTP id a640c23a62f3a-ab6cfcdf329mr2617366166b.17.1738663644344; Tue, 04 Feb 2025 02:07:24 -0800 (PST) Received: from localhost ([5.181.62.98]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab6e49ff724sm899846966b.105.2025.02.04.02.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 02:07:23 -0800 (PST) X-Google-Original-From: Sergey Bronnikov To: tarantool-patches@dev.tarantool.org, Sergey Kaplun Date: Tue, 4 Feb 2025 13:03:32 +0300 Message-Id: <6b70bd32f156ff24015bd48c45a404eafacd468a.1738663201.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit 1/4] test: add descriptions to sysprof testcases X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" The patch add descriptions to sysprof testcases to make TAP report more usable. --- .../profilers/misclib-sysprof-lapi.test.lua | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua index b2c38c49..581fb7fd 100644 --- a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua +++ b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua @@ -65,34 +65,35 @@ end -- Wrong profiling mode. local res, err, errno = misc.sysprof.start{ mode = "A" } -test:ok(res == nil and err:match("profiler misuse")) -test:ok(type(errno) == "number") +test:ok(res == nil and err:match("profiler misuse"), "res with no parameters") +test:ok(type(errno) == "number", "errno with no parameters") -- Already running. res, err = misc.sysprof.start{ mode = "D" } assert(res, err) res, err, errno = misc.sysprof.start{ mode = "D" } -test:ok(res == nil and err:match("profiler is running already")) -test:ok(type(errno) == "number") +test:ok(res == nil and err:match("profiler is running already"), + "ok with already running") +test:ok(type(errno) == "number", "errno with already running") res, err = misc.sysprof.stop() assert(res, err) -- Not running. res, err, errno = misc.sysprof.stop() -test:ok(res == nil and err) -test:ok(type(errno) == "number") +test:ok(res == nil and err, "res and error with not running") +test:ok(type(errno) == "number", "errno with not running") -- Bad path. res, err, errno = misc.sysprof.start({ mode = "C", path = BAD_PATH }) -test:ok(res == nil and err:match("No such file or directory")) -test:ok(type(errno) == "number") +test:ok(res == nil and err:match("No such file or directory"), "res and error with bad path") +test:ok(type(errno) == "number", "errno with bad path") -- Bad interval. res, err, errno = misc.sysprof.start{ mode = "C", interval = -1 } -test:ok(res == nil and err:match("profiler misuse")) -test:ok(type(errno) == "number") +test:ok(res == nil and err:match("profiler misuse"), "res and error with bad interval") +test:ok(type(errno) == "number", "errno with bad interval") -- DEFAULT MODE @@ -102,20 +103,23 @@ end local report = misc.sysprof.report() --- Check the profile is not empty -test:ok(report.samples > 0) +-- Check the profile is not empty. +test:ok(report.samples > 0, "number of samples is greater than 0") -- There is a Lua function with FNEW bytecode in it. Hence there -- are only three possible sample types: -- * LFUNC -- Lua payload is sampled. -- * GC -- Lua GC machinery triggered in scope of FNEW bytecode -- is sampled. -- * INTERP -- VM is in a specific state when the sample is taken. -test:ok(report.vmstate.LFUNC + report.vmstate.GC + report.vmstate.INTERP > 0) +test:ok(report.vmstate.LFUNC + report.vmstate.GC + report.vmstate.INTERP > 0, + "total number of LFUNC, GC and INTERP samples is greater than 0") -- There is no fast functions and C function in default payload. -test:ok(report.vmstate.FFUNC + report.vmstate.CFUNC == 0) +test:ok(report.vmstate.FFUNC + report.vmstate.CFUNC == 0, + "total number of FFUNC and CFUNC samples is equal to 0") -- Check all JIT-related VM states are not sampled. for _, vmstate in pairs({ 'TRACE', 'RECORD', 'OPT', 'ASM', 'EXIT' }) do - test:ok(report.vmstate[vmstate] == 0) + local msg = ("total number of VM state %s is equal to 0"):format(vmstate) + test:ok(report.vmstate[vmstate] == 0, msg) end -- With very big interval. @@ -124,7 +128,7 @@ if not pcall(generate_output, { mode = "D", interval = 1000 }) then end report = misc.sysprof.report() -test:ok(report.samples == 0) +test:ok(report.samples == 0, "total number of samples is equal to 0") -- LEAF MODE check_mode("L", 100) -- 2.34.1