示例#1
0
文件: syncer_test.go 项目: utako/atc
	"github.com/pivotal-golang/lager/lagertest"
	"github.com/tedsuo/ifrit"
	"github.com/tedsuo/ifrit/fake_runner"

	"github.com/concourse/atc/db"
	dbfakes "github.com/concourse/atc/db/fakes"
)

var _ = Describe("Pipelines Syncer", func() {
	var (
		pipelinesDB           *fakes.FakePipelinesDB
		pipelineDB            *dbfakes.FakePipelineDB
		otherPipelineDB       *dbfakes.FakePipelineDB
		pipelineDBFactory     *dbfakes.FakePipelineDBFactory
		pipelineRunnerFactory PipelineRunnerFactory

		fakeRunner         *fake_runner.FakeRunner
		fakeRunnerExitChan chan error
		otherFakeRunner    *fake_runner.FakeRunner

		syncer *Syncer
	)

	BeforeEach(func() {
		pipelinesDB = new(fakes.FakePipelinesDB)
		pipelineDB = new(dbfakes.FakePipelineDB)

		pipelineDBFactory = new(dbfakes.FakePipelineDBFactory)

		fakeRunner = new(fake_runner.FakeRunner)
		otherFakeRunner = new(fake_runner.FakeRunner)
示例#2
0
	"syscall"
	"time"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("GroupRunner", func() {
	var (
		started chan struct{}

		groupRunner  ifrit.Runner
		groupProcess ifrit.Process

		childRunner1Errors chan error
		childRunner2Errors chan error
		childRunner3Errors chan error

		childRunner1 *fake_runner.FakeRunner
		childRunner2 *fake_runner.FakeRunner
		childRunner3 *fake_runner.FakeRunner

		Δ time.Duration = 10 * time.Millisecond
	)

	BeforeEach(func() {
		childRunner1Errors = make(chan error)
		childRunner2Errors = make(chan error)
		childRunner3Errors = make(chan error)

		childRunner1 = &fake_runner.FakeRunner{
			RunStub: func(signals <-chan os.Signal, ready chan<- struct{}) error {