Ejemplo n.º 1
0
func testSingleSendFlakyGuaranteed(t *testing.T, events []modetest.EventInfo) {
	var collected [][]outputs.Data
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			CBPublish: modetest.PublishCollectAfterFailStart(25, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testGuaranteed, events, modetest.Signals(true), &collected)
}
Ejemplo n.º 2
0
func testSingleSendFlakyFail(t *testing.T, events []modetest.EventInfo) {
	var collected [][]common.MapStr
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			CBPublish: modetest.PublishCollectAfterFailStart(3, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(false), &collected)
}
Ejemplo n.º 3
0
func testLoadBalancerFlakyConnectionOkSend(t *testing.T, events []modetest.EventInfo) {
	var collected [][]outputs.Data
	mode, _ := NewSync(
		modetest.SyncClients(2, &modetest.MockClient{
			Connected: true,
			CBPublish: modetest.PublishCollectAfterFailStart(1, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
Ejemplo n.º 4
0
func testLoadBalancerFlakyGuaranteed(t *testing.T, events []modetest.EventInfo) {
	var collected [][]common.MapStr
	mode, _ := NewSync(
		modetest.SyncClients(2, &modetest.MockClient{
			Connected: true,
			CBPublish: modetest.PublishCollectAfterFailStart(25, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testGuaranteed, events, modetest.Signals(true), &collected)
}
Ejemplo n.º 5
0
func testSingleSendFlakyInfAttempts(t *testing.T, events []modetest.EventInfo) {
	enableLogging([]string{"*"})

	var collected [][]outputs.Data
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			CBPublish: modetest.PublishCollectAfterFailStart(25, &collected),
		}),
		0, // infinite number of send attempts
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}