@@ -1659,15 +1659,17 @@ def test_setsigdef_wrong_type(self):
1659
1659
os .environ , setsigdef = [signal .NSIG , signal .NSIG + 1 ])
1660
1660
1661
1661
@requires_sched
1662
+ @unittest .skipIf (sys .platform .startswith (('freebsd' , 'netbsd' )),
1663
+ "bpo-34685: test can fail on BSD" )
1662
1664
def test_setscheduler_only_param (self ):
1663
1665
policy = os .sched_getscheduler (0 )
1664
1666
priority = os .sched_get_priority_min (policy )
1665
1667
code = textwrap .dedent (f"""\
1666
- import os
1668
+ import os, sys
1667
1669
if os.sched_getscheduler(0) != { policy } :
1668
- os .exit(101)
1670
+ sys .exit(101)
1669
1671
if os.sched_getparam(0).sched_priority != { priority } :
1670
- os .exit(102)""" )
1672
+ sys .exit(102)""" )
1671
1673
pid = posix .posix_spawn (
1672
1674
sys .executable ,
1673
1675
[sys .executable , '-c' , code ],
@@ -1677,15 +1679,17 @@ def test_setscheduler_only_param(self):
1677
1679
self .assertEqual (os .waitpid (pid , 0 ), (pid , 0 ))
1678
1680
1679
1681
@requires_sched
1682
+ @unittest .skipIf (sys .platform .startswith (('freebsd' , 'netbsd' )),
1683
+ "bpo-34685: test can fail on BSD" )
1680
1684
def test_setscheduler_with_policy (self ):
1681
1685
policy = os .sched_getscheduler (0 )
1682
1686
priority = os .sched_get_priority_min (policy )
1683
1687
code = textwrap .dedent (f"""\
1684
- import os
1688
+ import os, sys
1685
1689
if os.sched_getscheduler(0) != { policy } :
1686
- os .exit(101)
1690
+ sys .exit(101)
1687
1691
if os.sched_getparam(0).sched_priority != { priority } :
1688
- os .exit(102)""" )
1692
+ sys .exit(102)""" )
1689
1693
pid = posix .posix_spawn (
1690
1694
sys .executable ,
1691
1695
[sys .executable , '-c' , code ],
0 commit comments