Skip to content

Make common tickers test more strict #7598

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

Closed
wants to merge 1 commit into from

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Jul 26, 2018

Description

The ticker specification requires that the ticker interrupt fires only
when the ticker times increments to or past the value set by
ticker_set_interrupt. The test for this, ticker_interrupt_test,
only asserted that the interrupt to fired within +-TICKER_DELTA of the
match value.

This patch removes TICKER_DELTA tolerance so the test will fail if the
interrupt does not fire at the exact time specified.

Pull request type

[x] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

The ticker specification requires that the ticker interrupt fires only
when the ticker times increments to or past the value set by
ticker_set_interrupt. The test for this, ticker_interrupt_test,
only asserted that the interrupt to fired within +-TICKER_DELTA of the
match value.

This patch removes TICKER_DELTA tolerance so the test will fail if the
interrupt does not fire at the exact time specified.
@0xc0170 0xc0170 requested a review from mprse July 26, 2018 09:08
@cmonr cmonr requested review from kjbracey and a team August 14, 2018 00:47
@cmonr
Copy link
Contributor

cmonr commented Aug 14, 2018

@mbed-os-test @kjbracey-arm @mprse Mind taking a look?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 1, 2018

I'll review this soon.

@mprse Can you review please?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 1, 2018

Why are we removing the delta (making it more strict) ? Does this change fit all targets?

@jamesbeyond
Copy link
Contributor

jamesbeyond commented Oct 1, 2018

Why are we removing the delta (making it more strict) ? Does this change fit all targets?

I got same question want to ask

@mprse
Copy link
Contributor

mprse commented Oct 2, 2018

I agree that form of the test which is proposed by @c1728p9 is closer to the requirements, then current version. It should be okay for boards which uses for Ticker one counter and CC registers to generate interrupts (e.g. NRF5x). But we have also boards like K64F which uses 2 counters. One for counting time and another for interrupt generation. I checked that interrupt test case fails on K64F with the fix and passes on NRF51_DK.

BTW I checked the implementation for K64F and it looks like there is a bug:

timestamp >= now_ticks ? timestamp - now_ticks : (uint32_t)((uint64_t) timestamp + 0xFFFFFFFF - now_ticks);

should be:
timestamp >= now_ticks ? timestamp - now_ticks : (uint32_t)((uint64_t) timestamp + 0xFFFFFFFF - now_ticks + 1);

But even with this + 1 the test fails (with fix).

@cmonr
Copy link
Contributor

cmonr commented Oct 19, 2018

@c1728p9 @mprse @jamesbeyond @0xc0170 Anything needed to keep this PR moving?

@mprse
Copy link
Contributor

mprse commented Oct 22, 2018

Anything needed to keep this PR moving?

I think we should run morph and check the results.

@cmonr
Copy link
Contributor

cmonr commented Oct 22, 2018

Will run since CI is idle, but the PR still needs to be reviewed.

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 22, 2018

Build : SUCCESS

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

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 22, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 22, 2018

@cmonr
Copy link
Contributor

cmonr commented Oct 23, 2018

Interesting. Might have been too strict.

Please take a look at the errors.

@ARMmbed/mbed-os-test @kjbracey-arm @mprse Please take a look when y'all have a chance.

@c1728p9
Copy link
Contributor Author

c1728p9 commented Oct 29, 2018

Closing this for now since it makes tests too strict for some platforms to pass, similar to #8129.

@jeromecoutant
Copy link
Collaborator

Hi
In some netsocket tests, a MBED_EXTENDED_TESTS macro exists.

Maybe you can keep some extra tests or this delta time definition within a new macro
in order to not loose better test implementation ?

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

Successfully merging this pull request may close these issues.

8 participants