chrysn / aiocoap

The Python CoAP library
Other
264 stars 119 forks source link

OSCORE runs slow with pypy #265

Closed chrysn closed 2 years ago

chrysn commented 2 years ago

When PyPy tests with (especially group) OSCORE are run under -X dev, the asyncio warnings about tasks taking more than 0.1 seconds trigger.

That's kind of understandable for the OSCORE plug tests (which run in separate processes), but weird for group OSCORE (where contexts are constantly created and deleted, but everything should be running in the long-term pypy3 process) -- sure there's signatures involved, but this ain't running on an old calculator.

Further investigation is needed; for now, the timeout is increased for pypy tests. (This might all be a bit easier to debug once tasks can be named in the oldest supported version).

chrysn commented 2 years ago

Found it: It's the combination of -Xdev and -m coverage. (It's perfectly understandable that coverage storing, especially in JIT environment, takes longer than makes sense for an async environment).

chrysn commented 2 years ago

Worse, unfortunately: The long delays also mean that some time critical tasks just don't work out, and simple attempts to generalize (increase EMPTY_ACK_DELAY, make the slow_resource test case respond in a multiple of that) caused yet other breakage.

Best solution for the time being appears to disable coverage for pypy -- it's not like there's a lot of coverage to be gained from there.