Skip to content

Test: deepsleep() API replacement #5147

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 1 commit into from
Oct 13, 2017

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Sep 20, 2017

Use sleep() as entry function + check to be certain we
are entering deepsleep when required by test (should be allowed as we use LowPower object).

This has dependency on fixing this issue #5076 (the test now fails, and will be fixed as today).

Tested using K64F and GCC ARM , these 2 tests affected, one failure at the moment

@jeromecoutant

@jeromecoutant
Copy link
Collaborator

In these tests, we should not allow deepsleep when sleep() is called ?

/* Make sure deepsleep is allowed, to go to deepsleep */
bool deep_sleep_allowed = sleep_manager_can_deep_sleep();
TEST_ASSERT_TRUE_MESSAGE(deep_sleep_allowed, "Deep sleep should be allowed");
sleep();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is assuming that using LowPower object does allow deepsleep, and using sleep() should go into deepsleep, but would it? :-) As this test is for drivers, this looks fine, what about the below test for hal? Same? no direct deepsleep hal call ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was speaking about lp_timeout_1s_sleep function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was speaking about lp_timeout_1s_sleep function.

Should have lock there.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Sep 20, 2017

cc @c1728p9 @mprse

@0xc0170
Copy link
Contributor Author

0xc0170 commented Sep 20, 2017

In these tests, we should not allow deepsleep when sleep() is called ?

Both changes are changes for deepsleep test cases, so deepsleep should be allowed and should be entered?

@0xc0170
Copy link
Contributor Author

0xc0170 commented Sep 28, 2017

Depends on #5148

@0xc0170
Copy link
Contributor Author

0xc0170 commented Oct 4, 2017

As the dependency was merged, this is opened for reviews

@mprse

@mprse
Copy link
Contributor

mprse commented Oct 5, 2017

Provided updates for handling deep-sleep mode are valid.
Missing test case description.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Oct 5, 2017

Missing test case description.

That's true, they should be documented. I can add a commit here, however might be better as a new patch

@jeromecoutant
Copy link
Collaborator

Hi
For me, there are 3 parts in this test:
1- LPT test in run mode
2- LPT test in sleep mode
3- LPT test in deep sleep mode

I assume current update is OK to force part 3.
For part 2, we should also forbid deepsleep ?

@0xc0170 0xc0170 force-pushed the fix_deepsleep_tests branch 2 times, most recently from 2026024 to e1d1c4d Compare October 5, 2017 13:18
@@ -75,6 +78,8 @@ void lp_timeout_1s_sleep(void)
sleep_manager_lock_deep_sleep();
timestamp_t start = us_ticker_read();
lpt.attach(&cb_done, 1);
bool deep_sleep_allowed = sleep_manager_can_deep_sleep();
TEST_ASSERT_FALSE_MESSAGE(deep_sleep_allowed, "Deep sleep should be allowed");
Copy link
Member

Choose a reason for hiding this comment

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

Since deepsleep() is not allowed now (as it should) the message is invalid.

@0xc0170 0xc0170 force-pushed the fix_deepsleep_tests branch from e1d1c4d to af141ac Compare October 5, 2017 15:43
Use sleep() as entry function + check to be certain we
are entering deepsleep when required by test (should be allowed)
@0xc0170 0xc0170 force-pushed the fix_deepsleep_tests branch from af141ac to b30c622 Compare October 5, 2017 15:44
@0xc0170
Copy link
Contributor Author

0xc0170 commented Oct 6, 2017

@fkjagodzinski Can you review again pls?

Copy link
Member

@fkjagodzinski fkjagodzinski left a comment

Choose a reason for hiding this comment

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

Missing test case description.

Please don't bother with comments for LowPowerTimeout test cases. I'll add them in #5106.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Oct 9, 2017

/morph test-nightly

@mbed-bot
Copy link

mbed-bot commented Oct 9, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1551

All builds and test passed!

@0xc0170
Copy link
Contributor Author

0xc0170 commented Oct 10, 2017

retest uvisor

@mbed-ci
Copy link

mbed-ci commented Oct 11, 2017

Build : SUCCESS

Build number : 102
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5147/

Triggering tests

/test mbed-os

@mbed-ci
Copy link

mbed-ci commented Oct 12, 2017

Test : SUCCESS

Build number : 52
Test logs :http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/5147/52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants