})

	AfterEach(func() {
		if !CurrentGinkgoTestDescription().Failed {
			err := client.DeleteDeployment(manifest.Name)
			Expect(err).NotTo(HaveOccurred())
		}
	})

	It("scales from 1 to 3 nodes", func() {
		var keyVals map[string]string

		By("setting a persistent value", func() {
			etcdClient := helpers.NewEtcdClient([]string{
				fmt.Sprintf("http://%s:4001", manifest.Properties.Etcd.Machines[0]),
			})

			err := etcdClient.Set(testKey, testValue)
			Expect(err).ToNot(HaveOccurred())
		})

		By("scaling up to 3 nodes", func() {
			manifest.Jobs[0], manifest.Properties = destiny.SetJobInstanceCount(manifest.Jobs[0], manifest.Networks[0], manifest.Properties, 3)

			members := manifest.EtcdMembers()
			Expect(members).To(HaveLen(3))

			yaml, err := manifest.ToYAML()
			Expect(err).NotTo(HaveOccurred())
			err := client.DeleteDeployment(manifest.Name)
			Expect(err).NotTo(HaveOccurred())
		}
	})

	It("persists data throughout the rolling deploy", func() {
		keyVals := make(map[string]string)

		By("setting a persistent value", func() {
			var etcdClientURLs []string

			for _, elem := range manifest.Properties.Etcd.Machines {
				etcdClientURLs = append(etcdClientURLs, "http://"+elem+":4001")
			}

			etcdClient := helpers.NewEtcdClient(etcdClientURLs)

			err := etcdClient.Set(testKey, testValue)
			Expect(err).ToNot(HaveOccurred())
		})

		By("deploying", func() {
			manifest.Properties.Etcd.HeartbeatIntervalInMilliseconds = 51

			yaml, err := manifest.ToYAML()
			Expect(err).NotTo(HaveOccurred())

			yaml, err = client.ResolveManifestVersions(yaml)
			Expect(err).NotTo(HaveOccurred())

			var wg sync.WaitGroup