Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Fix cxx_fwd_att.cpp:749 occasional test failure (#384,#428)#493

Merged
bourtemb merged 2 commits intotango-controls:tango-9-ltsfrom
bourtemb:fix-384
Oct 24, 2018
Merged

Fix cxx_fwd_att.cpp:749 occasional test failure (#384,#428)#493
bourtemb merged 2 commits intotango-controls:tango-9-ltsfrom
bourtemb:fix-384

Conversation

@bourtemb
Copy link
Copy Markdown
Member

Added a sleep time after sending AddObjPolling command to the root device and before subscribing event on the forwarded device to give some time for the polling to start up correctly and changed the assertion cb.cb_err == 1 into cb.cb_err == 0.

The test failures we were experiencing before were due to the fact that sometimes (most of the times) an error event was sent with the following exception:

Severity = ERROR 
Error reason = API_NoDataYet
Desc : No data available in cache for attribute short_attr_rw
Origin : Device_3Impl::read_attributes_from_cache

Severity = ERROR 
Error reason = API_AttributeFailed
Desc : Failed to read_attribute on device test/debian8/10, attribute short_attr_rw
Origin : DeviceProxy::read_attribute()

And sometimes, no error event was sent because the polling had enough time to start up correctly on the root device. So there was already a value available in the cache.
So the assertion (cb.cb_err == 1) was wrong in this last case because cb.cb_err was equal to 0.

@bourtemb
Copy link
Copy Markdown
Member Author

The error event API_NoDataYet was actually sent because fwd_device DeviceProxy source was set to CACHE by the previous test (test_polling_on_a_forwarded_attribute). So the synchronous call occurring during the event subscription is trying to read from the cache only and gets an exception because there is nothing yet in the cache.
If we add:
fwd_device->set_source(CACHE_DEV);
in test_event_on_a_forwarded_attribute() test, we could even remove
TangoSleep(1);
after AddObjPolling command.
The last test (test_locking_device_with_forwarded_attribute) should not be affected by that.
This change was implemented in fa27e33 commit

@bourtemb bourtemb requested a review from Ingvord October 24, 2018 07:40
Copy link
Copy Markdown
Member

@Ingvord Ingvord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@bourtemb bourtemb merged commit 4acee7b into tango-controls:tango-9-lts Oct 24, 2018
@bourtemb bourtemb deleted the fix-384 branch October 24, 2018 11:04
bourtemb added a commit that referenced this pull request Dec 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants