Skip to content

Commit 1617e67

Browse files
committed
fix(ci): exclude RL notebook from docs build and relax reinit perf threshold
The RL tutorial requires gymnasium ([rl] extra) which is not installed in the docs CI environment. Exclude it from notebook execution. Relax reinit performance test from 2s to 10s for 1000 iterations — CI runners are 3-4x slower than local machines (observed 7ms/call on Ubuntu, 3.7ms on Windows vs ~2ms locally).
1 parent ee51548 commit 1617e67

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
nb_execution_raise_on_error = True # Fail build on notebook errors (catch issues in CI)
5252
nb_execution_excludepatterns = [
5353
'verification/*', # Skip verification notebooks (long-running)
54+
'tutorials/15-reinforcement-learning.ipynb', # Requires gymnasium (rl extra)
5455
]
5556
nb_merge_streams = True # Merge stdout/stderr into single output
5657

tests/test_reinit.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ def test_busted_recovery(self):
158158

159159

160160
class TestReinitPerformance(unittest.TestCase):
161-
"""reinit() should be fast — target < 2ms per call."""
161+
"""Performance regression guard for reinit().
162+
163+
Design target: < 2ms per call on a developer machine.
164+
CI threshold: < 10ms per call (10s for 1000 calls) to accommodate
165+
slower CI runners (observed: Ubuntu ~7ms, Windows ~3.7ms).
166+
"""
162167

163168
@classmethod
164169
def setUpClass(cls):
@@ -172,14 +177,15 @@ def setUpClass(cls):
172177
cls.ss.TDS.init()
173178

174179
def test_1000_reinits_fast(self):
175-
"""1000 reinits should complete in < 2 seconds."""
180+
"""1000 reinits should complete in < 10 seconds."""
176181
t0 = time.perf_counter()
177182
for _ in range(1000):
178183
self.ss.TDS.reinit()
179184
elapsed = time.perf_counter() - t0
180185

181-
# < 2 seconds for 1000 reinits = < 2ms per reinit
182-
self.assertLess(elapsed, 2.0,
186+
# < 10 seconds for 1000 reinits = < 10ms per reinit
187+
# CI runners are slower than local machines; typical local ~2ms, CI ~7ms
188+
self.assertLess(elapsed, 10.0,
183189
f"1000 reinits took {elapsed:.2f}s ({elapsed/1000*1000:.1f}ms each)")
184190

185191

0 commit comments

Comments
 (0)