Skip to content

Commit

Permalink
remove sleeps from streaming tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erickpintor committed Sep 19, 2024
1 parent db5c395 commit 7678f5c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions tests/integration/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ def thread_fn():
stream_thread = threading.Thread(target=thread_fn)
stream_thread.start()

# adds a delay so the thread can open the stream,
# otherwise we could miss some events
time.sleep(0.5)

id = scoped_client.query(fql("Product.create({}).id")).data
scoped_client.query(fql("Product.byId(${id})!.delete()", id=id))
scoped_client.query(fql("Product.create({})"))
Expand Down Expand Up @@ -61,10 +57,6 @@ def thread_fn():
stream_thread = threading.Thread(target=thread_fn)
stream_thread.start()

# adds a delay so the thread can open the stream,
# otherwise we could miss some events
time.sleep(0.5)

scoped_client.query(fql("Product.create({})"))
scoped_client.query(fql("Product.create({})"))

Expand All @@ -86,10 +78,6 @@ def thread_fn():
stream_thread = threading.Thread(target=thread_fn)
stream_thread.start()

# adds a delay so the thread can open the stream,
# otherwise we could miss some events
time.sleep(0.5)

scoped_client.query(fql("Product.create({foo: 10})"))
scoped_client.query(fql("Product.create({foo: 10})"))

Expand Down Expand Up @@ -154,10 +142,6 @@ def thread_fn():
stream_thread = threading.Thread(target=thread_fn)
stream_thread.start()

# adds a delay so the thread can open the stream,
# otherwise we could miss some events
time.sleep(0.5)

scoped_client.query(fql("Product.create({})"))
scoped_client.query(fql("Product.create({})"))
scoped_client.query(fql("Product.create({})"))
Expand Down Expand Up @@ -191,10 +175,6 @@ def thread_fn():
stream_thread = threading.Thread(target=thread_fn)
stream_thread.start()

# adds a delay so the thread can open the stream,
# otherwise we could miss some events
time.sleep(0.5)

createFour = scoped_client.query(fql("Product.create({})"))
stream_thread.join()
assert events[0]["txn_ts"] == createTwo.txn_ts
Expand Down Expand Up @@ -254,10 +234,6 @@ def thread_fn():
stream_thread = threading.Thread(target=thread_fn)
stream_thread.start()

# adds a delay so the thread can open the stream,
# otherwise we could miss some events
time.sleep(0.5)

scoped_client.query(fql("Product.create({})"))
scoped_client.query(fql("Product.create({})"))
scoped_client.query(fql("Product.create({})"))
Expand Down

0 comments on commit 7678f5c

Please sign in to comment.