-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
add metadata-syncer unit-tests #11695
Conversation
test.check_equal( last_metadata, None ) | ||
test.check_equal( len(dropped_metadata), 0 ) | ||
syncer.enqueue_metadata( 2, new_metadata( 2 ) ) | ||
test.check( last_image ) and test.check_equal( image_id( last_image ), 2 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a counter in on_frame_ready
and check that both frames were handled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could record the frames that were received in on_frame_ready
... I'll see if I can add.
on_frame_ready( image, metadata ) | ||
id = image_id( image ) + 1 | ||
syncer.enqueue_frame( id, new_image( id )) | ||
# Can generate a 'RuntimeError: device or resource busy' and then the 2nd frame won't come out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment still relevant? What does it mean seeing this error, should we just try again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not relevant any more -- will remove or clarify it's what may happen if it's not working right...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now:
# Above used to generate a 'RuntimeError: device or resource busy' so the 2nd frame didn't
# come out - that's what we're testing: the syncer shouldn't be locked inside the callback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Also: