Skip to content

Tests fail when using Python 3.14 #581

Closed

Description

@martincostello

While working on .NET 11 support for the OpenTelemetry .NET SDK, which uses this test suite as part of its CI validation, I found that the tests don't work on Python 3.14, which is included in the .NET 11 SDK container images.

You can see such a failure here from #580:

======================================================================
ERROR: setUpModule (test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/trace-context/trace-context/test/test.py", line 34, in setUpModule
    server = server or TestServer(host = '127.0.0.1', port = 7777, timeout = 3)
                       ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/trace-context/trace-context/test/server.py", line 78, in __init__
    self.loop = asyncio.get_event_loop()
                ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/asyncio/events.py", line 715, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
                       % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.

----------------------------------------------------------------------
Ran 33 tests in 0.057s

I have a patch for this locally that seems to work, so I'll look to push up a fix.

Activity

  1. added a commit that references this issue on Mar 15, 2026
  2. SergeyKanzhelev commented on Mar 16, 2026

    @SergeyKanzhelev
    Member

    I have a patch for this locally that seems to work, so I'll look to push up a fix.

    yes please. Thank you!

  3. martincostello commented on Mar 16, 2026

    @martincostello
    ContributorAuthor
  4. added
    toolingThis issue or PR affects tooling or processes and does not affect the specification itself
    on Apr 21, 2026
  5. added a commit that references this issue on Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    toolingThis issue or PR affects tooling or processes and does not affect the specification itself

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions