Skip to content

twisted tests failing on main on github actions with Python 3.12.1 #12052

@alex

Description

@alex

In the past few days, pyca/cryptography's downstream running on twisted's tests have begun failing with:

twisted.web.test.test_tap.ServiceTests.test_HTTPSFailureOnMissingSSL
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_dist/test/test_worker.py", line 254, in test_runSkip
    result = self.workerRunTest(expectedCase)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_dist/test/test_worker.py", line 189, in workerRunTest
    self.assertEqual({"success": True}, self.successResultOf(d))
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_synctest.py", line 732, in successResultOf
    self.fail(
twisted.trial.unittest.FailTest: Success result expected on <Deferred at 0x7fd17c3581a0 current result: None>, found failure result instead:
Traceback (most recent call last):
--- <exception caught here> ---
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_dist/worker.py", line 305, in run
    return await self.callRemote(workercommands.Run, testCase=testCaseId)  # type: ignore[no-any-return]
twisted.protocols.amp.UnknownRemoteError: Code<UNKNOWN>: Unknown Error


twisted.trial._dist.test.test_worker.LocalWorkerAMPTests.test_runSkip
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_dist/test/test_workerreporter.py", line 137, in test_addSkipPyunit
    self.assertTestRun(
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_dist/test/test_workerreporter.py", line 48, in assertTestRun
    assert_that(run(self, target), matches_result(**expectations))
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_dist/test/test_workerreporter.py", line 34, in run
    assert_that(case.successResultOf(d), equal_to({"success": True}))
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_synctest.py", line 732, in successResultOf
    self.fail(
twisted.trial.unittest.FailTest: Success result expected on <Deferred at 0x7fd17c359760 current result: None>, found failure result instead:
Traceback (most recent call last):
--- <exception caught here> ---
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_dist/worker.py", line 305, in run
    return await self.callRemote(workercommands.Run, testCase=testCaseId)  # type: ignore[no-any-return]
twisted.protocols.amp.UnknownRemoteError: Code<UNKNOWN>: Unknown Error


twisted.trial._dist.test.test_workerreporter.WorkerReporterTests.test_addSkipPyunit
===============================================================================
Error: 
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/protocols/amp.py", line 1141, in checkKnownErrors
    key = error.trap(*command.allErrors)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/python/failure.py", line 481, in trap
    self.raiseException()
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/python/failure.py", line 505, in raiseException
    raise self.value.with_traceback(self.tb)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/internet/defer.py", line 2000, in _inlineCallbacks
    result = context.run(gen.send, result)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_dist/worker.py", line 97, in run
    suite.run(self._result)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/runner.py", line 269, in run
    TestSuite.run(self, result)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_asyncrunner.py", line 35, in run
    test(result)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/runner.py", line 231, in run
    super().run(result)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_asyncrunner.py", line 35, in run
    test(result)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/_asyncrunner.py", line 35, in run
    test(result)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/unittest/case.py", line 692, in __call__
    return self.run(*args, **kwds)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/unittest/case.py", line 662, in run
    result.stopTest(self)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/twisted/trial/reporter.py", line 149, in stopTest
    self._lastTime = self._getTime() - self._testStarted
builtins.AttributeError: 'WorkerReporter' object has no attribute '_testStarted'

twisted.trial._dist.test.test_worker.LocalWorkerAMPTests.test_runSkip
twisted.trial._dist.test.test_workerreporter.WorkerReporterTests.test_addSkipPyunit
-------------------------------------------------------------------------------
Ran 11068 tests in 114.943s

FAILED (skips=520, failures=2, errors=2, successes=10546)

Example CI run: https://github.com/pyca/cryptography/actions/runs/7194931288/job/19596527447

This appears to be correlated with a github actions CI image update: actions/runner-images@e6f1047

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions