func TestRetry_Abort_NoYield(t *testing.T) {
	ma := MaxAttempts{Times: 3, WaitFor: 10 * time.Second}
	startTime := time.Now()
	expectedEndTime := startTime.Add(ma.WaitFor)
	_ = How(ma.New()).This(func(controller ServiceController) error {
		controller.Abort()
		return nil
	})

	endTime := time.Now()

	// The test waited after abort, it should NOT do this
	if expectedEndTime.Before(endTime) || expectedEndTime.Equal(endTime) {
		t.Error("retry waited after abort was called and should not have")
	}
}
// TestMaxAttemptsService_Abort_NoWait ensures that Yield is not called after Abort is called
TestMaxAttemptsService_Abort_NoWait ensures that Yield is not called after Abort is called
// TestMaxAttemptsService_Abort_NoWait ensures that Yield is not called after Abort is called
func TestRetry_Abort_NoYield(t *testing.T) {
	ma := MaxAttempts{Times: 3, WaitFor: 10 * time.Second}
	startTime := time.Now()
	expectedEndTime := startTime.Add(ma.WaitFor)
	_ = How(ma.New()).This(func(controller ServiceController) error {
		controller.Abort()
		return nil
	})
	endTime := time.Now()
	if expectedEndTime.Before(endTime) || expectedEndTime.Equal(endTime) {
		t.Error("retry waited after abort was called and should not have")
	}
}
func TestRetry_Abort_NoYield ( t * testing . T ) { ma := MaxAttempts { Times : 3 , WaitFor : 10 * time . Second } startTime := time . Now ( ) expectedEndTime := startTime . Add ( ma . WaitFor ) _ = How ( ma . New ( ) ) . This ( func ( controller ServiceController ) error { controller . Abort ( ) return nil } ) endTime := time . Now ( ) if expectedEndTime . Before ( endTime ) || expectedEndTime . Equal ( endTime ) { t . Error ( " " ) } }
TestMaxAttemptsService_Abort_NoWait ensures that Yield is not called after Abort is called
TestMaxAttemptsService_Abort_NoWait ensures that Yield is not called after Abort is called
// The test waited after abort, it should NOT do this