示例#1
0
		})

		Context("when the cell rejects the start auction", func() {
			BeforeEach(func() {
				startAuction = BuildLRPAuction("pg-3", "domain", 1, linuxRootFSURL, 10, 10, clock.Now())

				clients["A-cell"].PerformReturns(rep.Work{LRPs: []rep.LRP{startAuction.LRP}}, nil)
				clients["B-cell"].PerformReturns(rep.Work{LRPs: []rep.LRP{startAuction.LRP}}, nil)

				clock.Increment(time.Minute)
				s := auctionrunner.NewScheduler(workPool, zones, clock, logger)
				results = s.Schedule(auctiontypes.AuctionRequest{LRPs: []auctiontypes.LRPAuction{startAuction}})
			})

			It("marks the start auction as failed", func() {
				startAuction.Attempts = 1
				Expect(results.SuccessfulLRPs).To(BeEmpty())
				Expect(results.FailedLRPs).To(ConsistOf(startAuction))
			})
		})

		Context("when there is no room", func() {
			BeforeEach(func() {
				startAuction = BuildLRPAuctionWithPlacementError("pg-4", "domain", 0, linuxRootFSURL, 1000, 1000, clock.Now(), rep.ErrorInsufficientResources.Error())
				clock.Increment(time.Minute)
				s := auctionrunner.NewScheduler(workPool, zones, clock, logger)
				results = s.Schedule(auctiontypes.AuctionRequest{LRPs: []auctiontypes.LRPAuction{startAuction}})
			})

			It("should not attempt to start the LRP", func() {
				Expect(clients["A-cell"].PerformCallCount()).To(Equal(0))