add metadata-syncer unit-tests - #11695
Merged
Merged
Conversation
OhadMeir
reviewed
Apr 18, 2023
| 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 ) |
Contributor
There was a problem hiding this comment.
Maybe add a counter in on_frame_ready and check that both frames were handled
Contributor
Author
There was a problem hiding this comment.
We could record the frames that were received in on_frame_ready... I'll see if I can add.
OhadMeir
reviewed
Apr 18, 2023
| 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 |
Contributor
There was a problem hiding this comment.
Is this comment still relevant? What does it mean seeing this error, should we just try again?
Contributor
Author
There was a problem hiding this comment.
Not relevant any more -- will remove or clarify it's what may happen if it's not working right...
Contributor
Author
There was a problem hiding this comment.
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also: