[lxc-devel] [lxd/master] test: Wait for operations to be removed from the database

freeekanayaka on Github lxc-bot at linuxcontainers.org
Mon Jul 27 11:28:10 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 698 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200727/12b6a5ff/attachment.bin>
-------------- next part --------------
From ebfa6777912ab0486da5ff50bfba372c1f7c1e56 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Mon, 27 Jul 2020 13:13:15 +0200
Subject: [PATCH] test: Wait for operations to be removed from the database

Pending operations take up to 5 seconds to be removed from the database, even
after completion. Since we don't record the status in the database, and that
status appears to be something that only the local node stores, we can't cheaply
know what the status is when we querying the database to decide placement of a
new container.

Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
 test/suites/clustering.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/suites/clustering.sh b/test/suites/clustering.sh
index bc51627d6f..a64dd98d8a 100644
--- a/test/suites/clustering.sh
+++ b/test/suites/clustering.sh
@@ -543,6 +543,7 @@ test_clustering_storage() {
 
     # Copy the container without specifying a target, it will be placed on node2
     # since it's the one with the least number of containers (0 vs 1)
+    sleep 5 # Wait for pending operations to be removed from the database
     LXD_DIR="${LXD_ONE_DIR}" lxc copy foo bar
     LXD_DIR="${LXD_ONE_DIR}" lxc info bar | grep -q "Location: node2"
 


More information about the lxc-devel mailing list