[issue12783] test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param

2011-08-21 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset a04e70d7d76c by Charles-François Natali in branch 'default':
Issue #12783: Fix test_posix failures on FreeBSD buildbots, due to
http://hg.python.org/cpython/rev/a04e70d7d76c

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12783
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12783] test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param

2011-08-21 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

The test now passes on FreeBSD buildbots.
Closing.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12783
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12783] test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param

2011-08-20 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

Here's a patch skipping this part of the test on FreeBSD (it actually also 
fails on FreeBSD 7.2).
Note that while calling sched_setparam(param) results in EINVAL with 
SCHED_OTHER processes, calling sched_setscheduler(SCHED_OTHER, param) works 
just fine...

--
keywords: +needs review, patch
nosy: +pitrou
stage: needs patch - patch review
versions: +Python 3.3
Added file: http://bugs.python.org/file22965/test_sched_freebsd.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12783
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12783] test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param

2011-08-20 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Sounds fine to me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12783
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12783] test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param

2011-08-19 Thread Charles-François Natali

New submission from Charles-François Natali neolo...@free.fr:

http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%206.4%203.x/builds/1734/steps/test/logs/stdio


==
ERROR: test_get_and_set_scheduler_and_param (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File 
/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_posix.py, line 
878, in test_get_and_set_scheduler_and_param
posix.sched_setparam(0, param)
OSError: [Errno 22] Invalid argument

--


The reason is quite simple:

http://freebsd.active-venture.com/FreeBSD-srctree/newsrc/posix4/ksched.c.html


/*
 * XXX About priorities
 *
 *  POSIX 1003.1b requires that numerically higher priorities be of
 *  higher priority.  It also permits sched_setparam to be
 *  implementation defined for SCHED_OTHER.  I don't like
 *  the notion of inverted priorites for normal processes when
 *  you can use setpriority for that.
 *
 *  I'm rejecting sched_setparam for SCHED_OTHER with EINVAL.
 */

[...]
int ksched_setparam(register_t *ret, struct ksched *ksched,
struct proc *p, const struct sched_param *param)
{
register_t policy;
int e;

e = getscheduler(policy, ksched, p);

if (e == 0)
{
if (policy == SCHED_OTHER)
e = EINVAL;
else
e = ksched_setscheduler(ret, ksched, p, policy, param);
}

return e;
}



And indeed, sched_setparam is implementation-defined if the process' scheduling 
policy is SCHED_OTHER, see 
http://pubs.opengroup.org/onlinepubs/007908799/xsh/sched_setparam.html

If the current scheduling policy for the process specified by pid is not 
SCHED_FIFO or SCHED_RR, including SCHED_OTHER, the result is 
implementation-dependent.


It seems that FreeBSD made the choice of returning EINVAL, but it changed in 
recent versions (the test passes on FreeBSD 8).

I'm not sure about the best solution though:
1) don't perform this test if the scheduling policy is not SCHED_RR or 
SCHED_FIFO
2) skip this test on FreeBSD versions that return EINVAL (maybe adding a new 
requires_freebsd_version to test.support)

--
components: Tests
messages: 142423
nosy: benjamin.peterson, neologix
priority: normal
severity: normal
stage: needs patch
status: open
title: test_posix failure on FreeBSD 6.4: test_get_and_set_scheduler_and_param
type: behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12783
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com