From 54445a196cd99908a8a491307fd0563f21c84565 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Tue, 9 Jan 2024 16:40:49 +0800 Subject: [PATCH] lints changes --- src/controller/python/test/test_scripts/base.py | 11 ++++------- .../subscription_resumption_capacity_test_ctrl1.py | 1 - .../subscription_resumption_capacity_test_ctrl2.py | 1 - .../test/test_scripts/subscription_resumption_test.py | 1 - 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/controller/python/test/test_scripts/base.py b/src/controller/python/test/test_scripts/base.py index 8dce14e5e2a8c4..aa716922f5b415 100644 --- a/src/controller/python/test/test_scripts/base.py +++ b/src/controller/python/test/test_scripts/base.py @@ -1437,7 +1437,6 @@ def TestSubscriptionResumptionCapacityStep1(self, nodeid: int, endpoint: int, su def TestSubscriptionResumptionCapacityStep2(self, nodeid: int, endpoint: int, remote_ip: str, ssh_port: int, remote_server_app: str, subscription_capacity: int): - remoteDeviceRestarted = False updateLock = threading.Lock() updateCv = threading.Condition(updateLock) @@ -1474,7 +1473,6 @@ def run(self): os.path.join(CHIP_REPO, "out/debug/standalone", self.remote_server_app), self.subscription_capacity)) with updateLock: - remoteDeviceRestarted = True updateCv.notifyAll() finally: @@ -1485,11 +1483,10 @@ def run(self): restartRemoteThread = _restartRemoteDevice(remote_ip, ssh_port, remote_server_app, subscription_capacity) restartRemoteThread.start() with updateCv: - while remoteDeviceRestarted is False: - if not updateCv.wait(8.0): - self.logger.error( - "Failed to restart the remote device") - break + if not updateCv.wait(8.0): + self.logger.error( + "Failed to restart the remote device") + # Wait for some time so that the device will be resolving the address of the first controller time.sleep(3) diff --git a/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl1.py b/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl1.py index fcf9dcffe1d33e..c5cecf4b8da2cb 100755 --- a/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl1.py +++ b/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl1.py @@ -21,7 +21,6 @@ import os import sys -import time from optparse import OptionParser from base import BaseTestHelper, FailIfNot, TestFail, TestTimeout, logger diff --git a/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl2.py b/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl2.py index f0eb69ca77656f..4e226e816abe52 100755 --- a/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl2.py +++ b/src/controller/python/test/test_scripts/subscription_resumption_capacity_test_ctrl2.py @@ -21,7 +21,6 @@ import os import sys -import time from optparse import OptionParser from base import BaseTestHelper, FailIfNot, TestFail, TestTimeout, logger diff --git a/src/controller/python/test/test_scripts/subscription_resumption_test.py b/src/controller/python/test/test_scripts/subscription_resumption_test.py index 5a3922d5524d5f..0b0c0c985db77a 100755 --- a/src/controller/python/test/test_scripts/subscription_resumption_test.py +++ b/src/controller/python/test/test_scripts/subscription_resumption_test.py @@ -21,7 +21,6 @@ import os import sys -import time from optparse import OptionParser from base import BaseTestHelper, FailIfNot, TestFail, TestTimeout, logger