You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2022/12/08 22:56:52 UTC
[libcloud] 04/04: Implement temporary workaround for race condition in newly added tests - we need to sure we only issue HTTP request once "send_code" thread is running.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 97ba9b5386eba5bdefc44da053b5d3ebcf3b60e8
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Thu Dec 8 23:52:42 2022 +0100
Implement temporary workaround for race condition in newly added tests
- we need to sure we only issue HTTP request once "send_code" thread is
running.
---
libcloud/test/common/test_google.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libcloud/test/common/test_google.py b/libcloud/test/common/test_google.py
index 6f4d2b7d7..b223af985 100644
--- a/libcloud/test/common/test_google.py
+++ b/libcloud/test/common/test_google.py
@@ -17,6 +17,7 @@ Tests for Google Connection classes.
"""
import os
import sys
+import time
import urllib
import datetime
import unittest
@@ -319,6 +320,9 @@ class GoogleInstalledAppAuthConnectionFirstLoginTest(LibcloudTestCase):
fake_google_response = threading.Thread(target=_send_code)
fake_sign_in_thread.start()
+ # TODO: Do a proper fix for race condition and only start get_code once _send_code
+ # is initialized and up and running
+ time.sleep(0.2)
fake_google_response.start()
fake_google_response.join()
fake_sign_in_thread.join()