Skip to content

[stress-tests] relax event limits in otns-performance test - #836

Merged
jwhui merged 1 commit into
openthread:mainfrom
abtink:stress-test/update-thresholds
Sep 17, 2026
Merged

jwhui merged 1 commit into
openthread:mainfrom
abtink:stress-test/update-thresholds

Conversation

@abtink

@abtink abtink commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

The otns-performance stress test simulates a 32-node router network for 3600 seconds of simulation time under a fixed PRNG seed (48392). Its primary pass criterion is execution time (<= 60s).

The test also enforces hardcoded upper bounds on AlarmEvents (900k) and RadioEvents (680k). These limits were tuned with very narrow headroom (~5%) against a specific baseline. Consequently, any subtle PRNG stream shift in the OpenThread stack during node initialization or runtime (e.g., slight variations in MLE advertisement or backoff jitters over a 1-hour simulation) can produce ~3–5% fluctuations in event totals, tripping these thresholds and falsely failing CI even when simulation performance easily passes (e.g. 35s execution time).

This commit relaxes the event count thresholds to provide adequate headroom (~15–20% margin) while continuing to catch runaway event loops or true performance regressions:

  • Increases AlarmEvents threshold to 1,100,000 (from 900,000).
  • Increases RadioEvents threshold to 800,000 (from 680,000).

Related to

The `otns-performance` stress test simulates a 32-node router network
for 3600 seconds of simulation time under a fixed PRNG seed (48392).
Its primary pass criterion is execution time (<= 60s).

The test also enforces hardcoded upper bounds on `AlarmEvents` (900k)
and `RadioEvents` (680k). These limits were tuned with very narrow
headroom (~5%) against a specific baseline. Consequently, any subtle
PRNG stream shift in the OpenThread stack during node initialization
or runtime (e.g., slight variations in MLE advertisement or backoff
jitters over a 1-hour simulation) can produce ~3–5% fluctuations in
event totals, tripping these thresholds and falsely failing CI even
when simulation performance easily passes (e.g. 35s execution time).

This commit relaxes the event count thresholds to provide adequate
headroom (~15–20% margin) while continuing to catch runaway event
loops or true performance regressions:

- Increases `AlarmEvents` threshold to 1,100,000 (from 900,000).
- Increases `RadioEvents` threshold to 800,000 (from 680,000).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request increases the threshold limits for AlarmEvents and RadioEvents in the OTNS performance stress test. The review feedback suggests defining these threshold values as variables or constants and using Python's numeric underscores (e.g., 1_100_000) to eliminate duplication between the comparison logic and the error messages, thereby improving readability and maintainability.

Comment thread pylibs/stress_tests/otns_performance.py
@abtink abtink added bug Something isn't working enhancement New feature or request P4 labels Sep 16, 2026
@jwhui
jwhui merged commit a580303 into openthread:main Sep 17, 2026
38 checks passed
EskoDijk pushed a commit to EskoDijk/ot-ns that referenced this pull request Sep 30, 2026
…ead#836)

The `otns-performance` stress test simulates a 32-node router network
for 3600 seconds of simulation time under a fixed PRNG seed (48392).
Its primary pass criterion is execution time (<= 60s).

The test also enforces hardcoded upper bounds on `AlarmEvents` (900k)
and `RadioEvents` (680k). These limits were tuned with very narrow
headroom (~5%) against a specific baseline. Consequently, any subtle
PRNG stream shift in the OpenThread stack during node initialization
or runtime (e.g., slight variations in MLE advertisement or backoff
jitters over a 1-hour simulation) can produce ~3–5% fluctuations in
event totals, tripping these thresholds and falsely failing CI even
when simulation performance easily passes (e.g. 35s execution time).

This commit relaxes the event count thresholds to provide adequate
headroom (~15–20% margin) while continuing to catch runaway event
loops or true performance regressions:

- Increases `AlarmEvents` threshold to 1,100,000 (from 900,000).
- Increases `RadioEvents` threshold to 800,000 (from 680,000).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request P4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[otns] stress-tests otns-performance is fragile to minor PRNG stream shifts due to overly tight event limits

3 participants