open-telemetry / open-telemetry/opentelemetry-python-contrib

New test failures in Fedora with 1.20.0/0.41b0

Open
#1,940 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

Describe your environment

Fedora 38, 39, or 40/Rawhide, with Python 3.12.0rc2.

Steps to reproduce

Run the tests.

What is the expected behavior?

All tests pass.

What is the actual behavior?

=================================== FAILURES ===================================
__________________ TestSanitizeMethod.test_nonstandard_method __________________

self = <tests.test_sanitize_method.TestSanitizeMethod testMethod=test_nonstandar
d_method>

    def test_nonstandard_method(self):
        method = sanitize_method("UNKNOWN")  
>       self.assertEqual(method, "NONSTANDARD")
E       AssertionError: 'UNKNOWN' != 'NONSTANDARD'
E       - UNKNOWN
E       + NONSTANDARD

util/opentelemetry-util-http/tests/test_sanitize_method.py:34: AssertionError
______________ TestSanitizeMethod.test_nonstandard_method_allowed ______________

self = <tests.test_sanitize_method.TestSanitizeMethod testMethod=test_nonstandard_method_allowed>

    @patch.dict(
    "os.environ",
        {   
            OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS: "1",
        },
    )
    def test_nonstandard_method_allowed(self):
        method = sanitize_method("UNKNOWN")
>       self.assertEqual(method, "NONSTANDARD")
E       AssertionError: 'UNKNOWN' != 'NONSTANDARD'
E       - UNKNOWN
E       + NONSTANDARD

util/opentelemetry-util-http/tests/test_sanitize_method.py:44: AssertionError

Additional context

I maintain the python-opentelemetry-contrib package in Fedora Linux.

It’s not immediately obvious (without reading a lot of code) where I should start looking for a root cause, but I’m happy to perform any experiments that might be helpful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with util/opentelemetry-util-http/tests/test_sanitize_method.py and run the two failing tests for sanitize_method("UNKNOWN"). Trace sanitize_method from those tests to identify why it returns UNKNOWN on Fedora with Python 3.12. The work is done when the affected tests pass and the expected NONSTANDARD behavior is restored.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.