TEST: Provide functionality to launch (fire) a function off a given task queue

Bug #1587725 reported by Ananth Suryanarayana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Medium
Ananth Suryanarayana

Bug Description

Many times especially in the tests, we need ability to run a function off a particular task queue such as bgp::Config. A lot of boiler plate code is required at the moment to achieve this simple task. Provide it through a class.

Also, add an ability to pause a test upon failure (Useful in integration tests, with introspect)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/20817
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/20817
Committed: http://github.org/Juniper/contrail-controller/commit/6e986c452690adc53f5bf4dcb63583c85c226a69
Submitter: Zuul
Branch: master

commit 6e986c452690adc53f5bf4dcb63583c85c226a69
Author: Ananth Suryanarayana <email address hidden>
Date: Tue May 31 21:43:41 2016 -0700

Provide TaskFire functionality to fire a function off a given task.
It can be as simple as a single line call with optional one (or none)
user arguments.

TaskFire(boost::bind(&GracefulRestartTest::GRTimerCallback, this, _1),
pc, "bgp::Config");

This calls GRTimerCallback() off bgp::Config task and returns _after_
the user function returns.

Also add an ability to pause a test after gtest failure.

Change-Id: I4f9b9fd368317c29849ef67563269cb1007f08e2
Closes-Bug: 1587725

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/20971
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
Megh Bhatt (meghb) wrote : Re: [Bug 1587725] [NEW] TEST: Provide functionality to launch (fire) a function off a given task queue

You can enqueue a boost::function<void(void)> on the WorkQueue created with task id and task instance of bgp::Config. Is that what you want to provide through a class or something else?

Thanks

Megh

> On May 31, 2016, at 9:39 PM, Ananth Suryanarayana <email address hidden> wrote:
>
> Public bug reported:
>
> Many times especially in the tests, we need ability to run a function
> off a particular task queue such as bgp::Config. A lot of boiler plate
> code is required at the moment to achieve this simple task. Provide it
> through a class.
>
> Also, add an ability to pause a test upon failure (Useful in integration
> tests, with introspect)
>
> ** Affects: juniperopenstack
> Importance: Undecided
> Assignee: Ananth Suryanarayana (anantha-l)
> Status: New
>
> --
> You received this bug notification because you are a member of Contrail
> Systems engineering, which is subscribed to Juniper Openstack.
> https://bugs.launchpad.net/bugs/1587725
>
> Title:
> TEST: Provide functionality to launch (fire) a function off a given
> task queue
>
> Status in Juniper Openstack:
> New
>
> Bug description:
> Many times especially in the tests, we need ability to run a function
> off a particular task queue such as bgp::Config. A lot of boiler plate
> code is required at the moment to achieve this simple task. Provide it
> through a class.
>
> Also, add an ability to pause a test upon failure (Useful in
> integration tests, with introspect)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juniperopenstack/+bug/1587725/+subscriptions

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/20971
Committed: http://github.org/Juniper/contrail-controller/commit/c393d44b81ea803ffd9cd69c0f0e1c582433173b
Submitter: Zuul
Branch: master

commit c393d44b81ea803ffd9cd69c0f0e1c582433173b
Author: Ananth Suryanarayana <email address hidden>
Date: Mon Jun 6 15:13:38 2016 -0700

Cleanup TaskFire() to not to take void * user args

boost::bind already provides functionality to bind what ever
args the clients needs to bind. That is also with type-checks.

Also introduce a wrapper TASK_UTIL_EXPECT_DEATH macro to
gtest EXPECT_DEATH that prevents unnecessary core files

Change-Id: I5d1b62ae1777a25fec4187e4e344e94b9ee42d06
Closes-Bug: 1587725

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.