-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thread_msg_block_wo_queue: add README & pexpect script, extend comments
Fixes #6680
- Loading branch information
1 parent
b0649e6
commit f2fa8bd
Showing
4 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Background | ||
========== | ||
Tests for the same situation as `thread_msg_block_w_queue`, but without an initialized message queue for the main thread: | ||
|
||
This test application checks for the behavior reported in https://github.com/RIOT-OS/RIOT/issues/100: | ||
|
||
Usually, when a thread (here `sender_thread`) sends a message to another thread (here the `main` thread) whose message queue already holds a message, the message of `sender_thread` is copied into `main`'s message queue and `sender_thread` is set to `STATUS_PENDING`. However, this should *not* happen if `sender_thread` is currently in `STATUS_REPLY_BLOCKED` mode, since it is in the middle of a different, blocking send. | ||
|
||
In the aforementioned issue, it was reported that this undesired behavior was happening. It has been fixed since, and this test ensures that it doesn't re-occur again. | ||
|
||
Expected result | ||
=============== | ||
The output should look as follows: | ||
|
||
``` | ||
sender_thread start | ||
main thread alive | ||
``` | ||
|
||
If you see | ||
``` | ||
ERROR: sender_thread should be blocking | ||
``` | ||
something went wrong. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (C) 2017 Lotte Steenbrink <lotte.steenbrink@fu-berlin.de> | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
|
||
import os | ||
import sys | ||
|
||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) | ||
import testrunner | ||
|
||
def testfunc(child): | ||
child.expect('sender_thread start\r\n') | ||
child.expect('main thread alive\r\n') | ||
|
||
if __name__ == "__main__": | ||
sys.exit(testrunner.run(testfunc)) |