Skip to content

Add duration kwarg to smurf.stream #227

@BrianJKoopman

Description

@BrianJKoopman

duration is a kwarg that isn't passed through the kwargs argument in the controller/sodetlib function, so it needs to be handled separately.

This was found when passing duration was attempted recently in a stimulator test:

Failed to start stream on OCSClient('det-controller-c4s7'), removing from targets list.
Operation stream in Agent det-controller-c4s7 is not 'running'.
Current OpCode: 6
OCSReply: OK : Session active.
  stream[session=223]; status=done with ERROR 2.1 mins ago, took 0.356534 s
  messages (4 of 4):
    1756868183.101 Status is now "starting".
    1756868183.103 Status is now "running".
    1756868183.453 CRASH: [Failure instance: Traceback: <class 'TypeError'>: stream_g3_on() got an unexpected keyword argument 'duration'
/usr/local/lib/python3.8/dist-packages/twisted/python/threadpool.py:269:inContext
/usr/local/lib/python3.8/dist-packages/twisted/python/threadpool.py:285:<lambda>
/usr/local/lib/python3.8/dist-packages/twisted/python/context.py:117:callWithContext
/usr/local/lib/python3.8/dist-packages/twisted/python/context.py:82:callWithContext
/usr/local/lib/python3.8/dist-packages/ocs/ocs_agent.py:984:_running_wrapper
/usr/local/lib/python3.8/dist-packages/socs/agents/pysmurf_controller/agent.py:460:stream
/usr/local/src/pysmurf/python/pysmurf/client/util/pub.py:50:wrapper
]
    1756868183.458 Status is now "done".
  other keys in .session: op_code, degraded, data

We'll need to just add a new kwarg in stream:

def stream(state, tag=None, subtype=None, wait_for_stream=True, **kwargs):
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions