-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
uORB_tests: add uORB::SubscriptionMultiArray tests #16093
Conversation
This also uncovers a small bug with Possibly already resolved by #16084. |
It may be because |
That should be it. I turned off test_single() first and did the test, and it passed. I see that in order to maintain independence, each unit test basically uses a different message. Maybe a new one should be used here. Or use copy several times in advance to read all the messages before executing the test. |
That's all true, but I still don't see why this isn't technically a real bug. The first subscription subscribes and reports the last generation as 1 (should be 2 from the earlier test_single()), then after it does the first copy the generation jumps to 3 (actual generation + 1). |
Oh, Then The generation is the total number of publishes, but it is used as an index starting from 0 inside the |
The test failed because of this:
If there is valid data before, we will reduce the initial value by 1 to get the latest data. Then it was released again in test_SubscriptionMulti(), our _last_generation = generation-2. In addition, there is no queue for the orb_test topic, so it was skipped twice when copying. My modification in #16084 cannot fix this problem. For this problem, we should use a copy before the start of this test case to point _last_generation to the latest data. Or it should be tested on a new topic. |
No description provided.