-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update graphiql version in template (#1191)
Co-authored-by: Damian Czajkowski <[email protected]>
- Loading branch information
1 parent
0c51268
commit 26581ba
Showing
10 changed files
with
124 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import time | ||
|
||
|
||
def wait_for_condition(condition_func, timeout=5, poll_interval=0.1): | ||
""" | ||
This function is particularly useful in scenarios where asynchronous operations | ||
are involved. For instance, in a WebSocket-based system, certain events or | ||
state changes, like setting a flag in a callback, may not occur instantly. | ||
The wait_for_condition function ensures that the test waits long enough for | ||
these asynchronous events to complete, preventing race conditions or false | ||
negatives in test outcomes. | ||
""" | ||
start_time = time.time() | ||
while time.time() - start_time < timeout: | ||
if condition_func(): | ||
return True | ||
time.sleep(poll_interval) | ||
return False |
Oops, something went wrong.