Skip to content

Commit

Permalink
fix transition counter
Browse files Browse the repository at this point in the history
  • Loading branch information
fjetter committed Aug 7, 2024
1 parent 7c61216 commit bb7d38e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions distributed/tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from dask.utils import parse_timedelta, tmpfile, typename

from distributed import (
CancelledError,
Client,
Event,
Future,
Expand Down Expand Up @@ -4170,16 +4169,15 @@ async def test_transition_counter(c, s, a):
assert a.state.transition_counter > 1


@pytest.mark.slow
@gen_cluster(client=True)
async def test_transition_counter_max_scheduler(c, s, a, b):
# This is set by @gen_cluster; it's False in production
assert s.transition_counter_max > 0
s.transition_counter_max = 1
with captured_logger("distributed.scheduler") as logger:
with pytest.raises(CancelledError):
with pytest.raises(AssertionError):
await c.submit(inc, 2)
assert s.transition_counter > 1
assert s.transition_counter == 1
with pytest.raises(AssertionError):
s.validate_state()
assert "transition_counter_max" in logger.getvalue()
Expand Down

0 comments on commit bb7d38e

Please sign in to comment.