Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/p4p version 4 #367

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Feature/p4p version 4 #367

wants to merge 2 commits into from

Conversation

BenBradnick
Copy link
Contributor

Updating p4p to version 4 has resulted in some subtle changes to the string representation of the PV Values.

Outstanding issue related to empty strings - the counter demo block has values e.g.:

string[] required = {0}[]

Whereas setting "required": [] in the expected string yields:

string[] required = {?}[]

I'm not sure how to replace the question mark with a zero-sized array. As this results in the failure during comparison:

-                 string[] required = {0}[]
?                                      ^
+                 string[] required = {?}[]
?                  

@BenBradnick
Copy link
Contributor Author

BenBradnick commented Feb 24, 2022

The other test failures in the system PVA test - the configure test seems a bit flaky now, but the exports test always fails.

It looks like the put_function in _handle_put of Controller does not ever return, with the call block.exports.put_value(t) in the test yielding (with some output to track progress in _handle_put:

TESTMOTION: handling put for exports (Put(id=3, path=Array(['TESTMOTION', 'exports', 'value']), value=ExportTable(source=Array(['x.counter']), export=Array(['xValue'])), get=False))
TESTMOTION: put function is: functools.partial(<bound method PvaClientComms.send_put of PvaClientComms(mri='PVA-CLIENT')>, 'TESTMOTION', 'exports')
TESTMOTION: calling put function functools.partial(<bound method PvaClientComms.send_put of PvaClientComms(mri='PVA-CLIENT')>, 'TESTMOTION', 'exports')
TESTMOTION: handling put for exports (Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False))
TESTMOTION: put function is: <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: calling put function <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: got result None from <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: returning from Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False)

TESTMOTION: handling put for exports (Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False))
TESTMOTION: put function is: <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: calling put function <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: got result None from <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: returning from Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False)

TESTMOTION: handling put for exports (Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False))
TESTMOTION: put function is: <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: calling put function <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: got result None from <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: returning from Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False)

TESTMOTION: handling put for exports (Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False))
TESTMOTION: put function is: <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: calling put function <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: got result None from <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: returning from Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False)

TESTMOTION: handling put for exports (Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False))
TESTMOTION: put function is: <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: calling put function <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: got result None from <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: returning from Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False)

TESTMOTION: handling put for exports (Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False))
TESTMOTION: put function is: <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: calling put function <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: got result None from <bound method ManagerController.set_exports of ManagerController(mri='TESTMOTION', config_dir='/tmp/tmp3y9rgffv', template_designs='', initial_design='', use_git=True)>
TESTMOTION: returning from Put(id=0, path=Array(['TESTMOTION', 'exports', 'value']), value=OrderedDict([('typeid', 'malcolm:core/Table:1.0'), ('source', ['x.counter']), ('export', ['xValue'])]), get=False)

With the exception:

malcolm.core.request:request.py:56 Exception raised for request Put(id=3, path=Array(['TESTMOTION', 'exports', 'value']), value=ExportTable(source=Array(['x.counter']), export=Array(['xValue'])), get=False)
Traceback (most recent call last):
  File "/scratch/cvl62853/pipenv/pymalcolm-1ptPfK7S/lib/python3.7/site-packages/p4p/client/cothread.py", line 160, in _put_one
    ret = done.Wait(timeout)
  File "/scratch/cvl62853/pipenv/pymalcolm-1ptPfK7S/lib/python3.7/site-packages/cothread/cothread.py", line 768, in Wait
    self._WaitUntil(deadline)
  File "/scratch/cvl62853/pipenv/pymalcolm-1ptPfK7S/lib/python3.7/site-packages/cothread/cothread.py", line 611, in _WaitUntil
    raise Timedout('Timed out waiting for event')
cothread.cothread.Timedout: Timed out waiting for event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant