Skip to content

test_battery_status.py::TestBatteryStatus::test_async_battery_status is very slow #1168

@llucax

Description

@llucax

What happened?

The test test_battery_status.py::TestBatteryStatus::test_async_battery_status is very slow, it takes about 6 seconds to complete.

What did you expect instead?

The test to run fast.

Affected version(s)

No response

Affected part(s)

Unit, integration and performance tests (part:tests)

Extra information

The problem seems to be in the finalization of either the mock_microgrid or the BatteryStatusTracker, as most of the time is spent in leaving the async with block having those 2.

Time machine is used to speed up the time, but maybe async solipsism isn't and there is something awaiting for some time in the finalization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    part:testsAffects the unit, integration and performance (benchmarks) teststype:tech-debtImproves the project without visible changes for users

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions