Skip to content

Commit 9654152

Browse files
committed
gh-130363: add a test resource to mark tests that need an idle system
Some tests are very sensitive to timing and will fail on a loaded system, typically because there are small windows for timeouts to trigger in. Some of these are poorly implemented tests which can be improved, but others may genuinely have strict timing requirements. Add a test resource so that these tests can be marked as such, and only ran when the system is known to be idle. Change-Id: I364eca150e7ac10e5ffd8cfb480135427e7dc5dd
1 parent 39ba4b6 commit 9654152

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Lib/test/libregrtest/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@
122122
123123
tzdata - Run tests that require timezone data.
124124
125+
idle - Run tests that require an otherwise idle system as
126+
they are sensitive to timing.
127+
125128
To enable all resources except one, use '-uall,-<resource>'. For
126129
example, to run all the tests except for the gui tests, give the
127130
option '-uall,-gui'.

Lib/test/libregrtest/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
ALL_RESOURCES = ('audio', 'curses', 'largefile', 'network',
36-
'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui', 'walltime')
36+
'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui', 'walltime', 'idle')
3737

3838
# Other resources excluded from --use=all:
3939
#
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add the ``idle`` resource for flagging tests that need an idle system as
2+
they're sensitive to timing.

0 commit comments

Comments
 (0)