Interrupts: replace fixed sleep with reusable counter polling#488
Merged
Conversation
Move generic interrupt counter validation into functestlib.sh so tests can reuse common /proc/interrupts parsing and polling logic. Add helpers to: - compare per-CPU interrupt counters between two interrupt lines - poll a named interrupt until all CPU counters increment - expose initial/final interrupt lines and parsed counter values to callers for test-specific reporting This supports replacing fixed sleeps in interrupt-based tests with a poll-until-progress flow, reducing LAVA runtime while still failing safely when counters do not advance within the configured timeout. Also add local ShellCheck SC2034 suppressions for intentionally exported helper result variables consumed by caller scripts. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
The Interrupts test waits for a hardcoded 120 seconds before comparing arch_timer interrupt counters. This is unnecessarily expensive in LAVA, especially when the counters usually increment within a few seconds. Replace the fixed sleep with a poll-until-progress loop. The test now records the initial arch_timer counters and polls until all per-CPU counters increment, with configurable timeout and poll interval. Defaults: - INTERRUPTS_WAIT_TIMEOUT_S=30 - INTERRUPTS_POLL_INTERVAL_S=2 This keeps the same validation goal while reducing LAVA runtime and still failing safely when timer counters do not progress. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
vnarapar
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the hardcoded 120-second wait in the Interrupts test with a reusable poll-until-progress flow.
The test still validates the same functional goal:
arch_timerinterrupt counters must increment on all CPUs. Instead of always sleeping for 120 seconds, it now polls the per-CPU interrupt counters and completes as soon as all counters advance.Why the changes required?
The previous test always waited 120 seconds before comparing timer counters. This is time-consuming in LAVA jobs, especially because the counters usually increment within a few seconds.
The new polling approach reduces LAVA runtime while keeping a safe timeout for real failures.
Validation results with the patch
https://lava.infra.foundries.io/scheduler/job/255924