Skip to content

test_posix_common: fix test_clock_gettime_rollover failure #55208

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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/posix/common/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ CONFIG_POSIX_MQUEUE=y
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_MAX_THREAD_BYTES=4
CONFIG_THREAD_NAME=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest not adding this here, but maybe adding the tickless option in testcase.yaml as another test configuration. Technically, you could also add newlib to that same configuration and if necessary, adjust allowed platforms in that configuration.

Copy link
Collaborator Author

@hakehuang hakehuang Mar 28, 2023

Choose a reason for hiding this comment

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

@cfriedt CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000, is to fix this issue #53605, and if we add disable tickless option and we will find the issue #56163.

I will add a new test config with disable tickless, once the fix is ready.

Copy link
Member

Choose a reason for hiding this comment

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

@hakehuang - I believe adding CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 to the test project is more of a workaround than a solution. I will try and adjust the testcase so that it passes for the nordic boards mentioned in 53605 and will work with you to ensure that 56163 works as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cfriedt , just a reminder, in the cortex_m_systick.c

uint32_t cyc = elapsed() + cycle_count - announced_cycles;
return cyc / CYC_PER_TICK;

so if the platform runs too fast, the default CYC_PER_TICK is 10000, which means the two timer read will return the same value.


CONFIG_SMP=n