Skip to content

Commit

Permalink
Fix test_infinite_slots
Browse files Browse the repository at this point in the history
  • Loading branch information
bperson authored and ashb committed Jun 17, 2021
1 parent 21f59f8 commit 42b7ef8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion airflow/models/pool.py
Expand Up @@ -117,8 +117,10 @@ def slots_stats(
).all()

# calculate queued and running metrics
count: int
for (pool_name, state, count) in state_count_by_pool:
# Some databases return decimal.Decimal here.
count = int(count)

stats_dict: Optional[PoolStats] = pools.get(pool_name)
if not stats_dict:
continue
Expand Down
4 changes: 2 additions & 2 deletions tests/models/test_pool.py
Expand Up @@ -110,10 +110,10 @@ def test_infinite_slots(self):
"running": 0,
},
"test_pool": {
"open": -1,
"open": float('inf'),
"queued": 1,
"running": 1,
"total": -1,
"total": float('inf'),
},
} == pool.slots_stats()

Expand Down

0 comments on commit 42b7ef8

Please sign in to comment.