Skip to content

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

@BenBradnick BenBradnick force-pushed the feature/p4p-version-4 branch from b652e8e to 383d41a Compare March 31, 2022 12:43
@tomtrafford tomtrafford force-pushed the master branch 3 times, most recently from 1d0e5fb to 75b7c89 Compare May 26, 2022 10:00
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.

1 participant