DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harman Kalra <hkalra@marvell.com>
To: "remy.horton@intel.com" <remy.horton@intel.com>,
	"anatoly.burakov@intel.com" <anatoly.burakov@intel.com>,
	"marko.kovacevic@intel.com" <marko.kovacevic@intel.com>,
	"john.mcnamara@intel.com" <john.mcnamara@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Harman Kalra" <hkalra@marvell.com>
Subject: [dpdk-dev] [PATCH v2 2/2] test/metrics: first test case fails on continuous
Date: Fri, 1 Mar 2019 10:07:41 +0000	[thread overview]
Message-ID: <1551434828-3518-2-git-send-email-hkalra@marvell.com> (raw)
In-Reply-To: <1551434828-3518-1-git-send-email-hkalra@marvell.com>

Issue is observed while running 'metrics_autotest' continuously
without quiting. During first execution all test cases pass but
second run onwards first test case fails as library is already
initialized.

To resolve, introduced a new API to deinitialise the library
after all test cases are executed.

Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
v2:
* Adding stable@dpdk.org into cc as patch 1/2 of same patchset falls
between bug fix and new feature.

 app/test/test_metrics.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/app/test/test_metrics.c b/app/test/test_metrics.c
index 3c2f36b8a..78b3936ee 100644
--- a/app/test/test_metrics.c
+++ b/app/test/test_metrics.c
@@ -28,6 +28,19 @@ test_metrics_init(void)
 	return TEST_SUCCESS;
 }
 
+/* Deinitialize metric module. This function must be called
+ * from a primary process after metrics usage is over
+ */
+static int
+test_metrics_deinitialize(void)
+{
+	int err = 0;
+	err = rte_metrics_deinit();
+	TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__);
+
+	return TEST_SUCCESS;
+}
+
  /* Test Case to check failures when memzone init is not done */
 static int
 test_metrics_without_init(void)
@@ -300,6 +313,10 @@ static struct unit_test_suite metrics_testsuite  = {
 		 * arraylist, count size
 		 */
 		TEST_CASE(test_metrics_get_values),
+
+		/* TEST CASE 8: Test to unregister metrics*/
+		TEST_CASE(test_metrics_deinitialize),
+
 		TEST_CASES_END()
 	}
 };
-- 
2.18.0

  reply	other threads:[~2019-03-01 10:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 14:45 [dpdk-dev] [PATCH 1/2] metrics: new API to deinitialise metrics library Harman Kalra
2019-02-22 14:45 ` [dpdk-dev] [PATCH 2/2] test/metrics: first test case fails on continuous execution Harman Kalra
2019-02-25 12:21   ` Remy Horton
2019-02-25 12:21 ` [dpdk-dev] [PATCH 1/2] metrics: new API to deinitialise metrics library Remy Horton
2019-02-27 10:51   ` Harman Kalra
2019-03-01 10:07     ` [dpdk-dev] [PATCH v2 " Harman Kalra
2019-03-01 10:07       ` Harman Kalra [this message]
2019-06-27 10:59       ` Pattan, Reshma
2019-06-27 11:03       ` Pattan, Reshma
2019-07-10 10:52         ` [dpdk-dev] [PATCH v3 " Harman Kalra
2019-07-10 10:52           ` [dpdk-dev] [PATCH v3 2/2] test/metrics: fix metrics autotest failure Harman Kalra
2019-07-10 22:08           ` [dpdk-dev] [dpdk-stable] [PATCH v3 1/2] metrics: new API to deinitialise metrics library Thomas Monjalon
2019-07-11  8:12             ` Harman Kalra
2019-07-11  8:34               ` Thomas Monjalon
2019-07-11  9:26                 ` [dpdk-dev] [PATCH v4 " Harman Kalra
2019-07-11  9:26                   ` [dpdk-dev] [PATCH v4 2/2] test/metrics: fix metrics autotest failure Harman Kalra
2019-07-16 10:49                   ` [dpdk-dev] [PATCH v4 1/2] metrics: new API to deinitialise metrics library Thomas Monjalon

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=1551434828-3518-2-git-send-email-hkalra@marvell.com \
    --to=hkalra@marvell.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=remy.horton@intel.com \
    --cc=stable@dpdk.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).