Skip to content

Commit

Permalink
Remove assertion that makes test_decider flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed May 12, 2020
1 parent 2f44b1a commit 6e2fbcc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions graphql/backend/tests/test_decider.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
if False:
from typing import Any

from time import sleep


class FakeBackend(GraphQLBackend):
def __init__(self, name, raises=False):
Expand Down Expand Up @@ -49,7 +51,7 @@ def test_decider_backend_healthy_backend():
decider_backend = GraphQLDeciderBackend(backend1, backend2)

document = decider_backend.document_from_string(schema, "{ hello }")
assert not backend1.reached
# assert not backend1.reached # this is flaky (race condition)
assert backend2.reached
assert document == "fallback"

Expand All @@ -69,18 +71,17 @@ def test_decider_backend_unhealthy_backend():
decider_backend = GraphQLDeciderBackend(backend1, backend2)

document = decider_backend.document_from_string(schema, "{ hello }")
assert not backend1.reached
# assert not backend1.reached # this is flaky (race condition)
assert backend2.reached
assert document == "fallback"

backend1.wait()
backend1.reset()
backend2.reset()
document = decider_backend.document_from_string(schema, "{ hello }")

assert document == "fallback"
assert not backend1.reached
assert not backend2.reached
assert document == "fallback"


def test_decider_old_syntax():
Expand Down

0 comments on commit 6e2fbcc

Please sign in to comment.