You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2020/08/18 14:50:51 UTC

[skywalking-python] branch process-propagation updated: Fix test

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch process-propagation
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git


The following commit(s) were added to refs/heads/process-propagation by this push:
     new 467a8cd  Fix test
467a8cd is described below

commit 467a8cd41a7c0f71c3a4eebcfe5fb5413bbfd0f4
Author: kezhenxu94 <ke...@163.com>
AuthorDate: Tue Aug 18 22:50:35 2020 +0800

    Fix test
---
 tests/plugin/__init__.py                     | 4 ++--
 tests/plugin/sw_process/services/consumer.py | 8 +++++---
 tests/plugin/sw_process/test_process.py      | 2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/plugin/__init__.py b/tests/plugin/__init__.py
index c838308..f858a1f 100644
--- a/tests/plugin/__init__.py
+++ b/tests/plugin/__init__.py
@@ -49,8 +49,8 @@ class BasePluginTest(unittest.TestCase, ABC):
 
     @classmethod
     def tearDownClass(cls):
-        # cls.compose.stop()
-        pass
+        cls.compose.stop()
+
     @classmethod
     def host(cls, service_port):
         # type: (ServicePort) -> str
diff --git a/tests/plugin/sw_process/services/consumer.py b/tests/plugin/sw_process/services/consumer.py
index cf30740..b2dcb3d 100644
--- a/tests/plugin/sw_process/services/consumer.py
+++ b/tests/plugin/sw_process/services/consumer.py
@@ -14,6 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+import time
+
 import requests
 
 from skywalking import agent, config
@@ -22,7 +24,8 @@ import multiprocessing
 
 
 def post():
-    requests.post("http://127.0.0.1:9091/users")
+    requests.post("http://provider:9091/users")
+    time.sleep(3)
 
 
 if __name__ == '__main__':
@@ -36,7 +39,6 @@ if __name__ == '__main__':
 
     app = Flask(__name__)
 
-
     @app.route("/users", methods=["POST", "GET"])
     def application():
         from skywalking.trace.context import get_context
@@ -46,7 +48,7 @@ if __name__ == '__main__':
         p1.start()
         p1.join()
 
-        res = requests.post("http://127.0.0.1:9091/users")
+        res = requests.post("http://provider:9091/users")
 
         return jsonify(res.json())
 
diff --git a/tests/plugin/sw_process/test_process.py b/tests/plugin/sw_process/test_process.py
index d9ca543..4efe2e5 100644
--- a/tests/plugin/sw_process/test_process.py
+++ b/tests/plugin/sw_process/test_process.py
@@ -33,7 +33,7 @@ class TestPlugin(BasePluginTest):
         cls.compose.wait_for(cls.url(('consumer', '9090'), 'users?test=test1&test=test2&test2=test2'))
 
     def test_plugin(self):
-        time.sleep(20)
+        time.sleep(10)
 
         self.validate()
         response = requests.get(TestPlugin.url(('consumer', '9090'), 'users'))