summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-04-26 14:47:20 +0000
committerGerrit Code Review <review@openstack.org>2018-04-26 14:47:20 +0000
commite9b82226a5641042e1aad1329efa6e3b376e7f3a (patch)
tree9c94434c6f120a00ead2adbc9bf4c1368f77bac7
parent148d624aace55479ee350fb561a9d92d01643d5d (diff)
parente1bd9670013f1c14cb40847117bf046ca81a26ab (diff)
Merge "Fix race in test_hold_expiration_no_default"3.0.1
-rw-r--r--nodepool/tests/fixtures/node_max_hold_age_no_default.yaml48
-rw-r--r--nodepool/tests/test_launcher.py4
2 files changed, 50 insertions, 2 deletions
diff --git a/nodepool/tests/fixtures/node_max_hold_age_no_default.yaml b/nodepool/tests/fixtures/node_max_hold_age_no_default.yaml
new file mode 100644
index 0000000..b42ae16
--- /dev/null
+++ b/nodepool/tests/fixtures/node_max_hold_age_no_default.yaml
@@ -0,0 +1,48 @@
1elements-dir: .
2images-dir: '{images_dir}'
3build-log-dir: '{build_log_dir}'
4
5zookeeper-servers:
6 - host: {zookeeper_host}
7 port: {zookeeper_port}
8 chroot: {zookeeper_chroot}
9
10labels:
11 - name: fake-label
12 min-ready: 1
13
14providers:
15 - name: fake-provider
16 cloud: fake
17 driver: fake
18 region-name: fake-region
19 rate: 0.0001
20 diskimages:
21 - name: fake-image
22 meta:
23 key: value
24 key2: value
25 pools:
26 - name: main
27 max-servers: 96
28 availability-zones:
29 - az1
30 networks:
31 - net-name
32 labels:
33 - name: fake-label
34 diskimage: fake-image
35 min-ram: 8192
36 flavor-name: 'Fake'
37
38diskimages:
39 - name: fake-image
40 elements:
41 - fedora
42 - vm
43 release: 21
44 env-vars:
45 TMPDIR: /opt/dib_tmp
46 DIB_IMAGE_CACHE: /opt/dib_cache
47 DIB_CLOUD_IMAGES: http://download.fedoraproject.org/pub/fedora/linux/releases/test/21-Beta/Cloud/Images/x86_64/
48 BASE_IMAGE_FILE: Fedora-Cloud-Base-20141029-21_Beta.x86_64.qcow2
diff --git a/nodepool/tests/test_launcher.py b/nodepool/tests/test_launcher.py
index 199c7af..672b947 100644
--- a/nodepool/tests/test_launcher.py
+++ b/nodepool/tests/test_launcher.py
@@ -735,7 +735,7 @@ class TestLauncher(tests.DBTestCase):
735 def test_hold_expiration_no_default(self): 735 def test_hold_expiration_no_default(self):
736 """Test a held node is deleted when past its operator-specified TTL, 736 """Test a held node is deleted when past its operator-specified TTL,
737 no max-hold-age set""" 737 no max-hold-age set"""
738 configfile = self.setup_config('node_max_ready_age.yaml') 738 configfile = self.setup_config('node_max_hold_age_no_default.yaml')
739 pool = self.useNodepool(configfile, watermark_sleep=1) 739 pool = self.useNodepool(configfile, watermark_sleep=1)
740 self.useBuilder(configfile) 740 self.useBuilder(configfile)
741 pool.start() 741 pool.start()
@@ -748,7 +748,7 @@ class TestLauncher(tests.DBTestCase):
748 # hold the node 748 # hold the node
749 node.state = zk.HOLD 749 node.state = zk.HOLD
750 node.comment = 'testing' 750 node.comment = 'testing'
751 node.hold_expiration = 5 751 node.hold_expiration = 1
752 self.zk.lockNode(node, blocking=False) 752 self.zk.lockNode(node, blocking=False)
753 self.zk.storeNode(node) 753 self.zk.storeNode(node)
754 self.zk.unlockNode(node) 754 self.zk.unlockNode(node)