2023-04-12 14:06:04 +00:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace DistTestCore
|
|
|
|
|
{
|
|
|
|
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
|
|
|
|
|
public class UseLongTimeoutsAttribute : PropertyAttribute
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface ITimeSet
|
|
|
|
|
{
|
|
|
|
|
TimeSpan HttpCallTimeout();
|
2023-05-10 07:55:36 +00:00
|
|
|
|
TimeSpan HttpCallRetryTimeout();
|
|
|
|
|
TimeSpan HttpCallRetryDelay();
|
2023-04-12 14:06:04 +00:00
|
|
|
|
TimeSpan WaitForK8sServiceDelay();
|
|
|
|
|
TimeSpan K8sOperationTimeout();
|
|
|
|
|
TimeSpan WaitForMetricTimeout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class DefaultTimeSet : ITimeSet
|
|
|
|
|
{
|
|
|
|
|
public TimeSpan HttpCallTimeout()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromSeconds(10);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 07:55:36 +00:00
|
|
|
|
public TimeSpan HttpCallRetryTimeout()
|
2023-04-12 14:06:04 +00:00
|
|
|
|
{
|
2023-05-11 10:44:53 +00:00
|
|
|
|
return TimeSpan.FromMinutes(1);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 07:55:36 +00:00
|
|
|
|
public TimeSpan HttpCallRetryDelay()
|
2023-04-12 14:06:04 +00:00
|
|
|
|
{
|
2023-06-08 11:23:26 +00:00
|
|
|
|
return TimeSpan.FromSeconds(1);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan WaitForK8sServiceDelay()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromSeconds(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan K8sOperationTimeout()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromMinutes(5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan WaitForMetricTimeout()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromSeconds(30);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class LongTimeSet : ITimeSet
|
|
|
|
|
{
|
|
|
|
|
public TimeSpan HttpCallTimeout()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromHours(2);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 07:55:36 +00:00
|
|
|
|
public TimeSpan HttpCallRetryTimeout()
|
2023-04-12 14:06:04 +00:00
|
|
|
|
{
|
2023-05-10 07:55:36 +00:00
|
|
|
|
return TimeSpan.FromHours(5);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 07:55:36 +00:00
|
|
|
|
public TimeSpan HttpCallRetryDelay()
|
2023-04-12 14:06:04 +00:00
|
|
|
|
{
|
2023-06-08 11:23:26 +00:00
|
|
|
|
return TimeSpan.FromSeconds(2);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan WaitForK8sServiceDelay()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromSeconds(10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan K8sOperationTimeout()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromMinutes(15);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TimeSpan WaitForMetricTimeout()
|
|
|
|
|
{
|
|
|
|
|
return TimeSpan.FromMinutes(5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|