Skip to content

Commit 24f1336

Browse files
authored
vdk-heartbeat: Introduce additional sleep when checking deployments (#2824)
With the introduction of the deployment synchronizer, the behaviour of the Control Service, when a data job is deployed, has changed slightly. Now, there is a slight delay between a job status changing from Enabled to Disabled, and the status being reflected in the output of the `vdk deploy --show` command. This causes the vdk heartbeat to fail, as it expects the changes to be applied immediately. This change adds a new check when the `check_deployments()` method is called, whose purpose is to verify that the job status has changed from enabled to disabled, and sleep for a bit if this is not the case. Testing Done: Executed the heartbeat locally with the command ```bash vdk-heartbeat -f test_basic_config.ini ``` Signed-off-by: Andon Andonov <andonova@vmware.com>
1 parent e6cbae4 commit 24f1336

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

projects/vdk-heartbeat/src/vdk/internal/heartbeat/job_controller.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ def check_deployments(self, enabled=True, timeout_seconds=600):
206206
if not deployments:
207207
log.info("No deployments so far. Will wait 30 seconds and try again.")
208208
time.sleep(30)
209+
elif deployments[0]["enabled"] != enabled:
210+
log.info(
211+
"Job deployment should be disabled, but is still enabled. Will wait for 30 seconds and try again."
212+
)
213+
time.sleep(30)
214+
deployments = None
209215
assert deployments, f"Job {self.config.job_name} deployment is missing"
210216
assert (
211217
deployments[0]["enabled"] == enabled

0 commit comments

Comments
 (0)