-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix hal-sleep/sleep_manager Tests on Cypress Targets #13210
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
Why this fix to Cypress targets need to change the behavior of greentea?
I doubt there will be unexpected consequences.
The Greentea message
{{KEY;VALUE}}is bidirectional,HOST<-->TARGETWhat if the HOST is windows sending
{{KEY;VALUE}}\r\nto target?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.
As described here: #12434 (comment) this is a long standing green tea bug, though as far as I know it only caused failures on our targets.
The choice of line ending in the case of greentea shouldn't have anything to do with the host OS. It appears to be merely convention that greentea KV pairs are sent with the '\n'. See: https://github.com/ARMmbed/mbed-os-tools/blob/master/src/mbed_os_tools/test/host_tests_conn_proxy/conn_primitive.py#L39
I don't see any reason why a Greentea message would be sent with a \r\n ending unless someone was perhaps manually testing messages with a serial emulator but had the wrong settings.
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.
The commit msg now should explain it. As the host is sending
\nwe should read it as well.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.
Hi @dustin-crossman,
Thanks for your updates. now I can fully understood the reason behind the change.
And I tried your changes, it is working on the automated test, but manual test on windows is not working as we expected. But I think manual test it is essential use case, I personally used it a lot during writing/debugging tests.
I am not sure why Greentea python tool put that
\nin the message in first place, maybe trying forcing flash the TX buffer? So lets leave it there as it is.So I'd like to propose the changes to:
}}\nBy doing this.
GT c++ is aligned with the GT python code
Your targets will have cleared RX buffer.
and manual test on windows or any platform will not get impact.
Also behavior of greentea unchanged ,and No docs/API updates are required.
What do you think?
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.
I'm not sure I really understand your goal here. I would think that the python greentea tool is the definitive place to look at for the format of a KV pair which states that a kv pair has a \n ending. Why not document that and keep all tools compliant with that?
It sounds like your manual tests are failing because they are sending \r\n. Why not fix that? Most serial emulators I've used have configurable line endings (on Windows or otherwise).
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.
Hi @dustin-crossman
My main goal here is try to fix the inconsistency of GT python, and GT C++ part (let your target pass), and reduced the impacts all GT users at same time.
It is not just me that using manual testing for GT, many other people also use it on windows. This change would break them as well. I would NOT expect all of them go and configure their windows serial terminals.
change the end token would means change behavior, that would means all the documents related to it need to be updated.
https://github.com/ARMmbed/mbed-os-5-docs/blob/development/docs/debugging-testing/testing/testing_greentea.md
https://github.com/ARMmbed/mbed-os-tools/tree/master/packages/mbed-greentea
https://github.com/ARMmbed/mbed-os-tools/tree/master/packages/mbed-host-tests
And possibly a new release of GT python tool.
That is huge trouble, not mention exist windows users might be stuck on this inconspicuous change looking for why.
I would say what I suggested is minimal changes with least effort, And resolved your targets failure, and no one got impacted.