コード例 #1
0
ファイル: evacuation_test.go プロジェクト: Gerg/inigo
			Path: "/tmp/go-server",
			Env:  []models.EnvironmentVariable{{"PORT", "8080"}},
		}

		err := receptorClient.CreateDesiredLRP(lrp)
		Expect(err).NotTo(HaveOccurred())

		By("running an actual LRP instance")
		Eventually(helpers.LRPStatePoller(receptorClient, processGuid, nil)).Should(Equal(receptor.ActualLRPStateRunning))
		Eventually(helpers.ResponseCodeFromHostPoller(componentMaker.Addresses.Router, helpers.DefaultHost)).Should(Equal(http.StatusOK))

		actualLRP, err := receptorClient.ActualLRPByProcessGuidAndIndex(processGuid, 0)
		Expect(err).NotTo(HaveOccurred())

		var evacuatingRepAddr string
		var evacutaingRepRunner *ginkgomon.Runner

		switch actualLRP.CellID {
		case cellAID:
			evacuatingRepAddr = cellARepAddr
			evacutaingRepRunner = cellARepRunner
		case cellBID:
			evacuatingRepAddr = cellBRepAddr
			evacutaingRepRunner = cellBRepRunner
		default:
			panic("what? who?")
		}

		By("posting the evacuation endpoint")
		resp, err := http.Post(fmt.Sprintf("http://%s/evacuate", evacuatingRepAddr), "text/html", nil)
		Expect(err).NotTo(HaveOccurred())
400, 0.04
500, 0.05
600, 0.06
`

var cpuMonitorData = `
[{"Percentage":[12.358514295296388, 19.1234123],"Timestamp":"2016-12-15T15:00:47.575579693-08:00"},
{"Percentage":[20.77922077922078, 22.23345],"Timestamp":"2016-12-15T15:00:47.672438722-08:00"}]
`

var _ = Describe("Throughputramp", func() {
	var (
		runner             *ginkgomon.Runner
		process            ifrit.Process
		testServer         *ghttp.Server
		testS3Server       *ghttp.Server
		comparisonFilePath string
		bodyChan           chan []byte
		runnerArgs         Args
		bodyTestHandler    http.HandlerFunc
	)

	Context("when correct arguments are used", func() {
		BeforeEach(func() {
			url := "http://example.com"
			testServer = ghttp.NewServer()
			handler := ghttp.CombineHandlers(
				func(rw http.ResponseWriter, req *http.Request) {
					Expect(req.Host).To(Equal(strings.TrimPrefix(url, "http://")))
				},
				ghttp.RespondWith(http.StatusOK, nil),
			)
コード例 #3
0
ファイル: main_test.go プロジェクト: cf-routing/nsync
				RootFs:                models.PreloadedRootFS("some-stack"),
				CompletionCallbackUrl: "http://google.com",
				CachedDependencies:    expectedCachedDependencies,
				Action:                models.WrapAction(expectedActions),
				LegacyDownloadUser:    "******",
			}))
		})
	})
})

var _ = Describe("Nsync Listener Initialization", func() {
	const exitDuration = 3 * time.Second

	var (
		nsyncPort int

		runner  *ginkgomon.Runner
		process ifrit.Process
	)

	BeforeEach(func() {
		nsyncPort = 8888 + GinkgoParallelNode()
		nsyncAddress := fmt.Sprintf("127.0.0.1:%d", nsyncPort)

		runner = newNSyncRunner(nsyncAddress)
	})

	JustBeforeEach(func() {
		process = ifrit.Invoke(runner)
	})

	AfterEach(func() {
コード例 #4
0
						Eventually(registeredRoutes).Should(Receive(&msg1))

						etcdRunner.Stop()
					})

					It("continues to broadcast routes", func() {
						Eventually(registeredRoutes, 5).Should(Receive(&msg2))
						Expect(msg2).To(MatchRegistryMessage(msg1))
					})
				})
			})
		})

		Context("and another emitter starts", func() {
			var (
				secondRunner  *ginkgomon.Runner
				secondEmitter ifrit.Process
			)

			BeforeEach(func() {
				secondRunner = createEmitterRunner("emitter2")
				secondRunner.StartCheck = "lock.acquiring-lock"

				secondEmitter = ginkgomon.Invoke(secondRunner)
			})

			AfterEach(func() {
				Expect(secondEmitter.Wait()).NotTo(Receive(), "Runner should not have exploded!")
				ginkgomon.Interrupt(secondEmitter, emitterInterruptTimeout)
			})

			Describe("the second emitter", func() {
コード例 #5
0
ファイル: main_test.go プロジェクト: cfibmers/nsync
			response, err = httpClient.Do(req)

			Expect(err).NotTo(HaveOccurred())
			Expect(response.StatusCode).To(Equal(http.StatusAccepted))

			Expect(desiredTheTask).To(BeTrue())
		})
	})
})

var _ = Describe("Nsync Listener Initialization", func() {
	const exitDuration = 3 * time.Second

	var (
		nsyncPort int

		runner  *ginkgomon.Runner
		process ifrit.Process
	)

	BeforeEach(func() {
		nsyncPort = 8888 + GinkgoParallelNode()
		nsyncAddress := fmt.Sprintf("127.0.0.1:%d", nsyncPort)

		runner = newNSyncRunner(nsyncAddress)
	})

	JustBeforeEach(func() {
		process = ifrit.Invoke(runner)
	})

	AfterEach(func() {