Skip to content

tests/mutex_order: refactor the test to avoid knowing the thread IDs#14229

Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom
keestux:fix-test-mutex-order
Jun 10, 2020
Merged

tests/mutex_order: refactor the test to avoid knowing the thread IDs#14229
aabadie merged 1 commit intoRIOT-OS:masterfrom
keestux:fix-test-mutex-order

Conversation

@keestux
Copy link
Contributor

@keestux keestux commented Jun 8, 2020

Contribution description

When CDC ACM is used as stdio the first thread in the test may have a
different ID than #3. The test code will now look at the printed thread
information (id, prio) as they are created. This avoids the need for a
table with ID/prio.

Testing procedure

Run tests/mutex_order with compile_and_test_for_board. Choose a board which uses CDC ACM as stdio. That means there are three threads active when the test starts. The test should succeed.

Run tests/mutex_order with compile_and_test_for_board. Choose a board which uses standard UART for stdio (no CDC ACM). That means there are two threads active when the test starts. The test should succeed.

Issues/PRs references

A similar problem was solved in #14181

@keestux keestux requested a review from miri64 as a code owner June 8, 2020 15:37
@keestux
Copy link
Contributor Author

keestux commented Jun 8, 2020

Testing this PR could make use of #14227

6: 2,
7: 1
}
NR_THREADS = 5
Copy link
Contributor

@aabadie aabadie Jun 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as in #14228 (#14228 (review))

@miri64 miri64 added Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: tests Area: tests and testing framework Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Jun 9, 2020
@miri64 miri64 requested review from bergzand and kaspar030 June 9, 2020 07:39
When CDC ACM is used as stdio the first thread in the test may have a
different ID than RIOT-OS#3. The test code will now look at the printed thread
information (id, prio) as they are created. This avoids the need for a
table with ID/prio.
@keestux keestux force-pushed the fix-test-mutex-order branch from 39e86a5 to fd01fde Compare June 9, 2020 20:56
@keestux
Copy link
Contributor Author

keestux commented Jun 9, 2020

@aabadie I applied the same changes as you requested in #14228 and I took the liberty to squash

@keestux keestux changed the title tests_mutex_order: refactor the test to avoid knowing the thread IDs tests/mutex_order: refactor the test to avoid knowing the thread IDs Jun 9, 2020
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes are good. Tested on native, samr21-xpro and arduino-mkr1000: all successful. On master it fails for the latter.

ACK!

@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 10, 2020
@aabadie aabadie merged commit 31e22d9 into RIOT-OS:master Jun 10, 2020
@keestux keestux deleted the fix-test-mutex-order branch June 10, 2020 18:58
@miri64 miri64 added this to the Release 2020.07 milestone Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants