Browse Source

Merge "Fix race in test_hold_expiration_no_default"

Zuul 1 year ago
parent
commit
e9b82226a5

+ 48
- 0
nodepool/tests/fixtures/node_max_hold_age_no_default.yaml View File

@@ -0,0 +1,48 @@
1
+elements-dir: .
2
+images-dir: '{images_dir}'
3
+build-log-dir: '{build_log_dir}'
4
+
5
+zookeeper-servers:
6
+  - host: {zookeeper_host}
7
+    port: {zookeeper_port}
8
+    chroot: {zookeeper_chroot}
9
+
10
+labels:
11
+  - name: fake-label
12
+    min-ready: 1
13
+
14
+providers:
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
+
38
+diskimages:
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

+ 2
- 2
nodepool/tests/test_launcher.py View File

@@ -735,7 +735,7 @@ class TestLauncher(tests.DBTestCase):
735 735
     def test_hold_expiration_no_default(self):
736 736
         """Test a held node is deleted when past its operator-specified TTL,
737 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 739
         pool = self.useNodepool(configfile, watermark_sleep=1)
740 740
         self.useBuilder(configfile)
741 741
         pool.start()
@@ -748,7 +748,7 @@ class TestLauncher(tests.DBTestCase):
748 748
         # hold the node
749 749
         node.state = zk.HOLD
750 750
         node.comment = 'testing'
751
-        node.hold_expiration = 5
751
+        node.hold_expiration = 1
752 752
         self.zk.lockNode(node, blocking=False)
753 753
         self.zk.storeNode(node)
754 754
         self.zk.unlockNode(node)

Loading…
Cancel
Save