Skip to content

Conversation

@sebhub
Copy link
Contributor

@sebhub sebhub commented Oct 22, 2025

Stop the CAN device in the test teardown to leave the CAN device in a neutral state.

@zephyrbot zephyrbot added area: CAN area: Tests Issues related to a particular existing or missing test labels Oct 22, 2025
Stop the CAN device in the test teardown to leave the CAN device in a
neutral state.

Signed-off-by: Sebastian Huber <[email protected]>
@sebhub sebhub force-pushed the can-classic-teardown branch from d509869 to 57a737b Compare October 22, 2025 02:37
@sonarqubecloud
Copy link

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

The description only says what you are changing, not why.

How come this is needed?

@sebhub
Copy link
Contributor Author

sebhub commented Oct 22, 2025

The description only says what you are changing, not why.

How come this is needed?

When you run multiple test suites (for example can_classic and can_timing) in a single application, the can_timing test suite could fail since the CAN device is started when the timings are set.

@henrikbrixandersen
Copy link
Member

When you run multiple test suites (for example can_classic and can_timing) in a single application, the can_timing test suite could fail since the CAN device is started when the timings are set.

How would you run these "in a single application"? These are two, distinct test suites, each an application on it's own.

@sebhub
Copy link
Contributor Author

sebhub commented Oct 22, 2025

When you run multiple test suites (for example can_classic and can_timing) in a single application, the can_timing test suite could fail since the CAN device is started when the timings are set.

How would you run these "in a single application"? These are two, distinct test suites, each an application on it's own.

I don't use Zephyr directly. I use parts of Zephyr together with the RTEMS real-time operating system. The operating system and the Zephyr components are shipped as a static library. I would like to test the library in exactly one configuration. To reduce the test time, I would like to run multiple tests suites in one executable. The test suites support setup and teardown handlers, so from a testing point of view this should be fine.

@henrikbrixandersen
Copy link
Member

don't use Zephyr directly. I use parts of Zephyr together with the RTEMS real-time operating system. The operating system and the Zephyr components are shipped as a static library.

This is in noway supported by Zephyr, sorry.

@sebhub
Copy link
Contributor Author

sebhub commented Oct 23, 2025

don't use Zephyr directly. I use parts of Zephyr together with the RTEMS real-time operating system. The operating system and the Zephyr components are shipped as a static library.

This is in noway supported by Zephyr, sorry.

It works pretty well, however, the rejection of changes like this just makes it harder. What is the cost for the Zephyr project to properly teardown a test suite even if it is not strictly required in the current arrangement? The test support has all the means to do this and calling a single function which is already used by the test suite is a very small overhead. You already have to do the stop/start for some test cases.

@henrikbrixandersen
Copy link
Member

What is the cost for the Zephyr project to properly teardown a test suite even if it is not strictly required in the current arrangement?

The cost is, that your use-case may break in another, unrelated way tomorrow. We have no means of verifying that this does not break (and it is not a supported use-case), so trying to maintain support for this will be chasing an undefined goal.

We cannot spend the time of upstream developers, maintainers, collaborators, and reviewers on this.

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

Labels

area: CAN area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants