Skip to content

on RHEL6 simple build fails with test_linux_constants (test.test_resource.ResourceTest) #63552

Closed

Description

@mcepl
mannequin
BPO 19353
Nosy @brettcannon, @tiran, @mcepl, @skrah, @vajrasky
Files
  • issue19353.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/brettcannon'
    closed_at = <Date 2013-10-26.13:23:44.393>
    created_at = <Date 2013-10-22.17:14:26.094>
    labels = ['type-bug', 'tests']
    title = 'on RHEL6 simple build fails with test_linux_constants (test.test_resource.ResourceTest)'
    updated_at = <Date 2013-10-26.13:23:44.391>
    user = 'https://github.com/mcepl'

    bugs.python.org fields:

    activity = <Date 2013-10-26.13:23:44.391>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2013-10-26.13:23:44.393>
    closer = 'brett.cannon'
    components = ['Tests']
    creation = <Date 2013-10-22.17:14:26.094>
    creator = 'mcepl'
    dependencies = []
    files = ['32305']
    hgrepos = []
    issue_num = 19353
    keywords = ['patch']
    message_count = 9.0
    messages = ['200973', '200977', '200979', '200981', '200993', '200994', '200998', '201333', '201353']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'christian.heimes', 'mcepl', 'skrah', 'vajrasky']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue19353'
    versions = ['Python 3.4']

    Activity

    1. mcepl commented on Oct 22, 2013

      mceplmannequin
      MannequinAuthor

      With pure clone of https://github.com/python/cpython.git (no patches applied whatsoever, and the last commit is 650406f) and pure

      ./configure && make -j2 && make -j2 test I get one failed test:

      ======================================================================
      ERROR: test_linux_constants (test.test_resource.ResourceTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/home/matej/Repos/cpython/Lib/test/test_resource.py", line 139, in test_linux_constants
          self.assertIsInstance(resource.RLIMIT_RTTIME, int)
      AttributeError: 'module' object has no attribute 'RLIMIT_RTTIME'

      Ran 9 tests in 0.468s

      FAILED (errors=1, skipped=1)
      test test_resource failed
      make: *** [test] Error 1

    2. skrah commented on Oct 22, 2013

      skrahmannequin
      Mannequin

      Christian, could you have a look? I think this was added in bpo-19324.

    3. tiran commented on Oct 22, 2013

      @tiran
      Member

      What's the output of "uname -r" on your machine?

    4. tiran commented on Oct 22, 2013

      @tiran
      Member

      Patch with fix.

      I'm checking the kernel version manually. requires_linux_version() works only per test. I don't want to write a test case for each attribute ...

    5. added
      testsTests in the Lib/test dir
      type-bugAn unexpected behavior, bug, or error
      on Oct 22, 2013
    6. vajrasky commented on Oct 23, 2013

      vajraskymannequin
      Mannequin

      Do we really need to test these constants in unit test?

      Other constants such as RLIMIT_STACK, RLIMIT_DATA, etc are not being tested. Other consideration includes people built custom kernel without these constants, or maybe they have outdated glibc.

      Additionally, it is very uncommon to use os.uname in unittest. Other than this test, it is only Lib/test/test_locale.py that uses os.uname.

    7. vajrasky commented on Oct 23, 2013

      vajraskymannequin
      Mannequin

      Or if we really want to test these constants, we can use something like this:

      if hasattr(resource, 'RLIMIT_NICE'):
          self.assertIsInstance(resource.RLIMIT_NICE, int)

      Or if we want to be so strict:

      if hasattr(resource, 'RLIMIT_NICE'):
          self.assertTrue(-20 <= resource.RLIMIT_NICE <= 19)

      Reference:
      http://man7.org/conf/lca2006/Linux_2.6_changes/rlimit_5.html

      RLIMIT_NICE (2.6.12)

      Process nice value has range -20 (high) to +19 (low); influences kernel scheduler.
      
    8. mcepl commented on Oct 23, 2013

      mceplmannequin
      MannequinAuthor

      On 22/10/13 20:43, Christian Heimes wrote:

      Christian Heimes added the comment:

      What's the output of "uname -r" on your machine?

      2.6.32-358.23.2.el6.i686

    9. vajrasky commented on Oct 26, 2013

      vajraskymannequin
      Mannequin

      This issue has been accidentally fixed by http://hg.python.org/cpython/rev/513da56d28de commit.

      Time to close it? Any last words?

    10. brettcannon commented on Oct 26, 2013

      @brettcannon
      Member

      Since the test now passes I'm going to close this as fixed.

    11. self-assigned this
      on Oct 26, 2013
    12. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions