Skip to content
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

tests: drivers: build_all: sensor: do not run build-only testsuite #60959

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Jul 30, 2023

A recent modification to the build_all/sensor testsuite changed build-only to false in testcase.yaml, which is causing CI to go bonkers.

https://bit.ly/3rSe0Te

Please do not run build-only testsuites.

Fixes #60958

A recent modification to the `build_all/sensor` testsuite changed
`build-only` to `false` in `testcase.yaml`, which is causing CI
to go bonkers.

https://bit.ly/3rSe0Te

Do not run build-only testsuites.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
@cfriedt cfriedt added bug The issue is a bug, or the PR is fixing a bug area: Sensors Sensors area: Tests Issues related to a particular existing or missing test Hotfix Fix for issues blocking development, i.e. CI issues, tests failing in CI, etc. labels Jul 30, 2023
@cfriedt cfriedt requested a review from a team July 30, 2023 14:52
@cfriedt cfriedt requested a review from nashif as a code owner July 30, 2023 14:52
@cfriedt cfriedt merged commit 5b4d275 into zephyrproject-rtos:main Jul 30, 2023
24 checks passed
@tristan-google
Copy link
Collaborator

Hi @cfriedt et. al., just wanted to follow up on this. I submitted the change that added the sensors.generic_test testcase and made it build+run recently in PR #60394. What this test does is described in that PR's description but the rationale for placing it here was to take advantage of the sensor build_all test's massive devicetree of sensors. It is indented to run but I don't blame you for reverting that to get CI back on track quickly. If there is a more appropriate place to locate this I'm happy to discuss.

On the topic of what went wrong in CI based on the log, a sensor (MAX17262) got stuck in a loop within its init function and spammed the log every 10ms, attempting to make a transaction on the I2C bus. This of course fails since there is neither an emulator nor phsyical device attached, but that shouldn't matter as drivers are expected to fail gracefully if they cannot initialize and simply remain not ready. Taking a look at this driver, I found a bug where the return code from the I2C read/write function calls are not error-checked. So if the read fails the tmp variable is never loaded with an legit value leaving it uninitialized. This never happened in my dozens of local test runs, but apparently in this CI run the right bit happened to be set to get stuck in that polling loop and it held everything up. I'm going to upload a PR for this driver to add error checks to prevent this. I do think there is value in trying to initialize all of these drivers in addition to building them. This would be the second driver bug I've caught through this test (the first surfaced during development and was fixed in #60119)

@cfriedt cfriedt deleted the issues/60958/tests-drivers-build-all-sensor-build-only-testsuite-is-being-run-in-ci branch August 1, 2023 11:37
@cfriedt
Copy link
Member Author

cfriedt commented Aug 1, 2023

Hi @cfriedt et. al., just wanted to follow up on this. I submitted the change that added the sensors.generic_test testcase and made it build+run recently in PR #60394. What this test does is described in that PR's description but the rationale for placing it here was to take advantage of the sensor build_all test's massive devicetree of sensors. It is indented to run but I don't blame you for reverting that to get CI back on track quickly. If there is a more appropriate place to locate this I'm happy to discuss.

Hi @tristan-google - I think the change you made makes total sense, so just wanted to get that out there. I try to never critique the author but try to focus on critiquing code. In this case, there wasn't even anything wrong with the code per se. It just happened to make CI go kind of off the rails.

On the topic of what went wrong in CI based on the log, a sensor (MAX17262) got stuck in a loop within its init function and spammed the log every 10ms, attempting to make a transaction on the I2C bus. This of course fails since there is neither an emulator nor phsyical device attached, but that shouldn't matter as drivers are expected to fail gracefully if they cannot initialize and simply remain not ready.

100% agree - I didn't go for a deep dive here, but thanks for looking into the root cause.

Taking a look at this driver, I found a bug where the return code from the I2C read/write function calls are not error-checked. So if the read fails the tmp variable is never loaded with an legit value leaving it uninitialized. This never happened in my dozens of local test runs, but apparently in this CI run the right bit happened to be set to get stuck in that polling loop and it held everything up. I'm going to upload a PR for this driver to add error checks to prevent this. I do think there is value in trying to initialize all of these drivers in addition to building them. This would be the second driver bug I've caught through this test (the first surfaced during development and was fixed in #60119)

Awesome - as long as @MaureenHelm is OK with it, I'm ok with that testcase.yaml permutation being run in CI too once the driver is fixed.

Thanks for following up, and sorry for not seeing your message until today, but GH notifications are a bit like drinking from the firehose for maintainers.

@tristan-google
Copy link
Collaborator

Thanks Chris. The bug fix for that driver is now merged in #61016. Looking forward to hearing from Maureen.

tristan-google added a commit to tristan-google/zephyr that referenced this pull request Aug 2, 2023
This test was turned off last weekend when a sensor misbehaved and broke
the CI, but that issue was resolved in zephyrproject-rtos#61016. This PR turns the test
back on.

For more info on what this test does, please see zephyrproject-rtos#60394.

For more context see also the comments under zephyrproject-rtos#60959

Signed-off-by: Tristan Honscheid <honscheid@google.com>
carlescufi pushed a commit that referenced this pull request Aug 3, 2023
This test was turned off last weekend when a sensor misbehaved and broke
the CI, but that issue was resolved in #61016. This PR turns the test
back on.

For more info on what this test does, please see #60394.

For more context see also the comments under #60959

Signed-off-by: Tristan Honscheid <honscheid@google.com>
kunoh pushed a commit to kunoh/zephyr that referenced this pull request Aug 7, 2023
This test was turned off last weekend when a sensor misbehaved and broke
the CI, but that issue was resolved in zephyrproject-rtos#61016. This PR turns the test
back on.

For more info on what this test does, please see zephyrproject-rtos#60394.

For more context see also the comments under zephyrproject-rtos#60959

Signed-off-by: Tristan Honscheid <honscheid@google.com>
umarnisar92 pushed a commit to nisarumar/zephyr that referenced this pull request Aug 15, 2023
This test was turned off last weekend when a sensor misbehaved and broke
the CI, but that issue was resolved in zephyrproject-rtos#61016. This PR turns the test
back on.

For more info on what this test does, please see zephyrproject-rtos#60394.

For more context see also the comments under zephyrproject-rtos#60959

Signed-off-by: Tristan Honscheid <honscheid@google.com>
meshium pushed a commit to meshium/zephyr that referenced this pull request Aug 16, 2023
This test was turned off last weekend when a sensor misbehaved and broke
the CI, but that issue was resolved in zephyrproject-rtos#61016. This PR turns the test
back on.

For more info on what this test does, please see zephyrproject-rtos#60394.

For more context see also the comments under zephyrproject-rtos#60959

Signed-off-by: Tristan Honscheid <honscheid@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Sensors Sensors area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug Hotfix Fix for issues blocking development, i.e. CI issues, tests failing in CI, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests: drivers: build_all: sensor: build-only testsuite is being run in CI
5 participants