<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/taskflow.git/taskflow/tests/unit, branch 4.6.2</title>
<subtitle>opendev.org: openstack/taskflow.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/'/>
<entry>
<title>Use unittest.mock instead of mock</title>
<updated>2021-04-27T21:47:11+00:00</updated>
<author>
<name>Hervé Beraud</name>
<email>hberaud@redhat.com</email>
</author>
<published>2021-01-05T08:14:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=14a5c0f237362f88c88f23175268b67084dfac1f'/>
<id>14a5c0f237362f88c88f23175268b67084dfac1f</id>
<content type='text'>
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: Ib169e3deb7ddb2bc93a206ebec4043552281aa7f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: Ib169e3deb7ddb2bc93a206ebec4043552281aa7f
</pre>
</div>
</content>
</entry>
<entry>
<title>Add sentinel redis support</title>
<updated>2020-08-05T13:03:25+00:00</updated>
<author>
<name>Ann Taraday</name>
<email>akamyshnikova@mirantis.com</email>
</author>
<published>2020-07-28T13:29:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=f17252de50e857140c389f768caaff831e509ee7'/>
<id>f17252de50e857140c389f768caaff831e509ee7</id>
<content type='text'>
Redis client has an ability to connect to Redis server
using Sentinel[1] (especially important for Redis clusters),
but this ability was missing here.

Allow to pass 'sentinel' variable to Redis conf, extend
_make_client to use sentinel for that case.

[1] - https://github.com/andymccurdy/redis-py#sentinel-support

Change-Id: Ia8cc98e701435fd0231da3724f5d7108fc4f96f4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Redis client has an ability to connect to Redis server
using Sentinel[1] (especially important for Redis clusters),
but this ability was missing here.

Allow to pass 'sentinel' variable to Redis conf, extend
_make_client to use sentinel for that case.

[1] - https://github.com/andymccurdy/redis-py#sentinel-support

Change-Id: Ia8cc98e701435fd0231da3724f5d7108fc4f96f4
</pre>
</div>
</content>
</entry>
<entry>
<title>Switch from unittest2 compat methods to Python 3.x methods</title>
<updated>2020-07-05T12:04:04+00:00</updated>
<author>
<name>melissaml</name>
<email>ma.lei@99cloud.net</email>
</author>
<published>2020-07-05T12:04:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=cf327a2e2d4e2c504b5080fbf7bd48421fe7b4c7'/>
<id>cf327a2e2d4e2c504b5080fbf7bd48421fe7b4c7</id>
<content type='text'>
With the removal of Python 2.x we can remove the unittest2 compat
wrappers and switch to assertCountEqual instead of assertItemsEqual

We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: Iaa8251a1e9965a00fe99b7a740a104c011260340
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the removal of Python 2.x we can remove the unittest2 compat
wrappers and switch to assertCountEqual instead of assertItemsEqual

We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: Iaa8251a1e9965a00fe99b7a740a104c011260340
</pre>
</div>
</content>
</entry>
<entry>
<title>Update TaskFlow for networkx 2.x</title>
<updated>2019-10-19T01:11:44+00:00</updated>
<author>
<name>Michael Johnson</name>
<email>johnsomor@gmail.com</email>
</author>
<published>2019-10-19T01:02:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=dc6495cfa1c8e1dc95bad554a55f0b4e8e360abe'/>
<id>dc6495cfa1c8e1dc95bad554a55f0b4e8e360abe</id>
<content type='text'>
The networkx 2.x series has been out for two years now and supports
python 3.6 and greater[1]. This patch updates TaskFlow to require
a minimum of networkx 2.1. It also updates the code to support
recent deprecation expiration introduced in the 2.4 release.

[1] https://networkx.github.io/documentation/stable/news.html

Change-Id: Ife31d353ba80824ebc63c8b21ee90943badc8da3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The networkx 2.x series has been out for two years now and supports
python 3.6 and greater[1]. This patch updates TaskFlow to require
a minimum of networkx 2.1. It also updates the code to support
recent deprecation expiration introduced in the 2.4 release.

[1] https://networkx.github.io/documentation/stable/news.html

Change-Id: Ife31d353ba80824ebc63c8b21ee90943badc8da3
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix code to support networkx &gt; 1.0</title>
<updated>2018-07-11T11:11:51+00:00</updated>
<author>
<name>Michal Arbet</name>
<email>michal.arbet@ultimum.io</email>
</author>
<published>2018-06-25T14:06:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=d985c5a256bcf8f67e80235ba387599f448f2c49'/>
<id>d985c5a256bcf8f67e80235ba387599f448f2c49</id>
<content type='text'>
With the release of NetworkX 2.0 the reporting API was
moved to view/iterator model. Many methods were moved from
reporting lists or dicts to iterating over the information.
Methods that used to return containers now return views and
methods that returned iterators have been removed in networkx.
Because of this change in NetworkX 2.0 , taskflow code
have to be changed also to support networkx &gt; 2.0

Change-Id: I23c226f37bd85c1e38039fbcb302a2d0de49f333
Closes-Bug: #1778115
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the release of NetworkX 2.0 the reporting API was
moved to view/iterator model. Many methods were moved from
reporting lists or dicts to iterating over the information.
Methods that used to return containers now return views and
methods that returned iterators have been removed in networkx.
Because of this change in NetworkX 2.0 , taskflow code
have to be changed also to support networkx &gt; 2.0

Change-Id: I23c226f37bd85c1e38039fbcb302a2d0de49f333
Closes-Bug: #1778115
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix invalid json unit test</title>
<updated>2018-02-08T17:13:05+00:00</updated>
<author>
<name>Ben Nemec</name>
<email>bnemec@redhat.com</email>
</author>
<published>2018-02-08T16:58:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=44ce6eae918d44c0ee85998d0526e916dee8de26'/>
<id>44ce6eae918d44c0ee85998d0526e916dee8de26</id>
<content type='text'>
Recent versions of oslo.serialization have made it possible to dump
exceptions to JSON, which broke a unit test in taskflow that
assumed exceptions were unserializable.  This change switches to an
explicitly unserializable class for that test.

Change-Id: If6d19bc9fcf1f1813cb087d42dc7ba6a61c71b3d
Closes-Bug: 1748241
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Recent versions of oslo.serialization have made it possible to dump
exceptions to JSON, which broke a unit test in taskflow that
assumed exceptions were unserializable.  This change switches to an
explicitly unserializable class for that test.

Change-Id: If6d19bc9fcf1f1813cb087d42dc7ba6a61c71b3d
Closes-Bug: 1748241
</pre>
</div>
</content>
</entry>
<entry>
<title>Update URLs in documents according to document migration</title>
<updated>2017-07-13T04:05:18+00:00</updated>
<author>
<name>ChangBo Guo(gcb)</name>
<email>eric.guo@easystack.cn</email>
</author>
<published>2017-07-13T04:05:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=40645e19a7036f8e7b1e5d7d1a37a5ef874cfc4c'/>
<id>40645e19a7036f8e7b1e5d7d1a37a5ef874cfc4c</id>
<content type='text'>
Change-Id: I9ca92fdcec388e02462332e04fe7c1bf8b5f64b8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I9ca92fdcec388e02462332e04fe7c1bf8b5f64b8
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix process based executor task proxying-back events</title>
<updated>2017-07-11T03:14:04+00:00</updated>
<author>
<name>Joshua Harlow</name>
<email>harlowja@yahoo-inc.com</email>
</author>
<published>2016-01-25T23:56:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=84c7a7b2c7dcbade1bc802cac7c93ccd9b746cb3'/>
<id>84c7a7b2c7dcbade1bc802cac7c93ccd9b746cb3</id>
<content type='text'>
Let's dive into what the problem is here.

First a description of what happens to a task that
is to be executed in a external (but local) process
via the process executor mechanism.

When a task is about to be sent to execute in the
external (but local) process its first cloned, this
is mainly done so that its notification callbacks can
be altered in a safe manner (ie not altering the
original task object to do this) and that clone has
its notifier emptied out.

What replaces the clone's notifier callbacks though
is a new object (that has a __call__ method so it
looks like just another callback) that will send
messages to the parent process (the one that has
the engine in it) over a secure(ish) channel whenever
the local task triggers its notifier notify() method.

This allows for callbacks in the parent process to
get triggered because once the messages recieved the
original tasks notifier object has its notify() method
called (therefore those callbacks do not really know
the task they are getting messages from is executing out
of process).

The issue though is that if the ANY(*) event type is registered
due to how it works in the notifier is that if the child/cloned
notifier has the ANY event type registered and the cloned task
calls notify() with a specific event this will cause the ANY
callback (in the clone) to transmit a message *and* it will
cause the *specific* event callback to also transmit a message
back to the parent process.

On the engine process side it will get 2 messages and trigger
the callbacks 3 times (twice for the specific event callback
because how the local notifier has the ANY callback registered
and one more time when the local process also sends the same
event based on its registration of the ANY event in the child
process).

This is not what is expected (the message rcved on the engine
process should only trigger one callback to get triggered
if the engine process task has no ANY callback registered or two
engine process callbacks to get triggered if the engine process
task has the ANY callback registered).

Closes-Bug: #1537948

Change-Id: I271bf1f23ad73df6c177cf00fd902c4881ba44ae
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let's dive into what the problem is here.

First a description of what happens to a task that
is to be executed in a external (but local) process
via the process executor mechanism.

When a task is about to be sent to execute in the
external (but local) process its first cloned, this
is mainly done so that its notification callbacks can
be altered in a safe manner (ie not altering the
original task object to do this) and that clone has
its notifier emptied out.

What replaces the clone's notifier callbacks though
is a new object (that has a __call__ method so it
looks like just another callback) that will send
messages to the parent process (the one that has
the engine in it) over a secure(ish) channel whenever
the local task triggers its notifier notify() method.

This allows for callbacks in the parent process to
get triggered because once the messages recieved the
original tasks notifier object has its notify() method
called (therefore those callbacks do not really know
the task they are getting messages from is executing out
of process).

The issue though is that if the ANY(*) event type is registered
due to how it works in the notifier is that if the child/cloned
notifier has the ANY event type registered and the cloned task
calls notify() with a specific event this will cause the ANY
callback (in the clone) to transmit a message *and* it will
cause the *specific* event callback to also transmit a message
back to the parent process.

On the engine process side it will get 2 messages and trigger
the callbacks 3 times (twice for the specific event callback
because how the local notifier has the ANY callback registered
and one more time when the local process also sends the same
event based on its registration of the ANY event in the child
process).

This is not what is expected (the message rcved on the engine
process should only trigger one callback to get triggered
if the engine process task has no ANY callback registered or two
engine process callbacks to get triggered if the engine process
task has the ANY callback registered).

Closes-Bug: #1537948

Change-Id: I271bf1f23ad73df6c177cf00fd902c4881ba44ae
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace assertRaisesRegexp with assertRaisesRegex</title>
<updated>2017-06-03T06:40:12+00:00</updated>
<author>
<name>Vu Cong Tuan</name>
<email>tuanvc@vn.fujitsu.com</email>
</author>
<published>2017-06-03T05:28:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=db61fad6b237934f410e9ccbd1c24cf13e6c53fb'/>
<id>db61fad6b237934f410e9ccbd1c24cf13e6c53fb</id>
<content type='text'>
assertRaisesRegexp was renamed to assertRaisesRegex in Py3.2
For more details, please check:
https://docs.python.org/3/library/
unittest.html#unittest.TestCase.assertRaisesRegex

Change-Id: I89cce19e80b04074aab9f49a76c7652acace78b3
Closes-Bug: #1436957
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
assertRaisesRegexp was renamed to assertRaisesRegex in Py3.2
For more details, please check:
https://docs.python.org/3/library/
unittest.html#unittest.TestCase.assertRaisesRegex

Change-Id: I89cce19e80b04074aab9f49a76c7652acace78b3
Closes-Bug: #1436957
</pre>
</div>
</content>
</entry>
<entry>
<title>do not allow redis job reclaim by same owner</title>
<updated>2017-05-13T14:55:50+00:00</updated>
<author>
<name>Rick van de Loo</name>
<email>rickvandeloo@gmail.com</email>
</author>
<published>2017-05-13T14:55:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openstack/taskflow.git/commit/?id=5f3c1325239bace46c6adfe775f544467af44b03'/>
<id>5f3c1325239bace46c6adfe775f544467af44b03</id>
<content type='text'>
Running a nonblocking conductor or two conductors on the same host will re-execute the same job multiple times with the current implementation of 'claim' for the redis jobboard backend. This is different from the ZooKeeper jobboard backend, there the same owner of a job is not allowed to reclaim the job again (https://github.com/openstack/taskflow/blob/master/taskflow/jobs/backends/impl_zookeeper.py#L554). If the same owner is allowed to reclaim the job again there can be no concurrent execution on the same owner because all jobs will be re-claimed and re-executed by the same owner every pass as long as it's on the jobboard.

To reproduce this behavior:

- Use the redis jobboard backend
- Create a flow with a task that sleeps 10 seconds in the execute method
- Post that flow as a job
- Run a nonblocking conductor

It will claim and execute the same job multiple times in a loop until the first worker is finished and consumes the job. After this change it will not re-execute the same job multiple times.

Change-Id: I4f6c364211500e510fc496f23b03ce056771417d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Running a nonblocking conductor or two conductors on the same host will re-execute the same job multiple times with the current implementation of 'claim' for the redis jobboard backend. This is different from the ZooKeeper jobboard backend, there the same owner of a job is not allowed to reclaim the job again (https://github.com/openstack/taskflow/blob/master/taskflow/jobs/backends/impl_zookeeper.py#L554). If the same owner is allowed to reclaim the job again there can be no concurrent execution on the same owner because all jobs will be re-claimed and re-executed by the same owner every pass as long as it's on the jobboard.

To reproduce this behavior:

- Use the redis jobboard backend
- Create a flow with a task that sleeps 10 seconds in the execute method
- Post that flow as a job
- Run a nonblocking conductor

It will claim and execute the same job multiple times in a loop until the first worker is finished and consumes the job. After this change it will not re-execute the same job multiple times.

Change-Id: I4f6c364211500e510fc496f23b03ce056771417d
</pre>
</div>
</content>
</entry>
</feed>
