729 references to FromSeconds
aspire (3)
Aspire.Azure.AI.OpenAI.Tests (1)
Aspire.Cli.Tests (18)
Aspire.Dashboard (15)
Aspire.Dashboard.Components.Tests (5)
Aspire.Dashboard.Tests (3)
Aspire.EndToEnd.Tests (9)
Aspire.Hosting (19)
Aspire.Hosting.Azure (2)
Aspire.Hosting.Azure.Tests (13)
Aspire.Hosting.Containers.Tests (1)
Aspire.Hosting.Docker.Tests (1)
Aspire.Hosting.Garnet (1)
Aspire.Hosting.Garnet.Tests (4)
Aspire.Hosting.Kafka.Tests (3)
Aspire.Hosting.MongoDB.Tests (4)
Aspire.Hosting.MySql.Tests (7)
MySqlFunctionalTests.cs (7)
70.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() })
124.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
303.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() })
390.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() })
474.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() })
618.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
692.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
Aspire.Hosting.OpenAI (2)
Aspire.Hosting.Oracle.Tests (3)
Aspire.Hosting.PostgreSQL.Tests (5)
Aspire.Hosting.Python.Tests (1)
Aspire.Hosting.Qdrant.Tests (2)
Aspire.Hosting.Redis (1)
Aspire.Hosting.Redis.Tests (4)
Aspire.Hosting.SqlServer.Tests (5)
SqlServerFunctionalTests.cs (5)
66.AddRetry(new() { MaxRetryAttempts = int.MaxValue, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
131.AddRetry(new() { MaxRetryAttempts = int.MaxValue, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
341.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
407.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
460.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
Aspire.Hosting.Testing.Tests (5)
Aspire.Hosting.Tests (46)
Aspire.Hosting.Valkey (1)
Aspire.Hosting.Valkey.Tests (2)
Aspire.Hosting.Yarp.Tests (4)
Aspire.NATS.Net.Tests (1)
Aspire.Playground.Tests (4)
Aspire.Pomelo.EntityFrameworkCore.MySql (2)
Aspire.RabbitMQ.Client (1)
Aspire.RabbitMQ.Client.Tests (1)
Aspire.RabbitMQ.Client.v7.Tests (1)
Aspire.StackExchange.Redis (1)
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
Aspire.StackExchange.Redis.Tests (1)
Aspire.Templates.Tests (12)
AzureAppConfiguration.Web (1)
AzureSearch.ApiService (1)
Consumer (1)
CosmosEndToEnd.ApiService (1)
CustomResources.AppHost (1)
dotnet-svcutil-lib (3)
HealthChecksSandbox.AppHost (1)
InMemory.FunctionalTests (81)
Http2\Http2TimeoutTests.cs (29)
218AdvanceTime(TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) +
219limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5));
353limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
375AdvanceTime(TimeSpan.FromSeconds((_bytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) +
376limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5));
406limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
427var timeToWriteMaxData = TimeSpan.FromSeconds((_bytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) +
428limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5);
461limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
484AdvanceTime(TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) +
485limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5));
513limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
535var timeToWriteMaxData = TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) +
536limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5);
567limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
601var timeToWriteMaxData = TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) +
602limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5);
633limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
680limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
700var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5);
731limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
761var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond);
767timeToReadMaxData -= TimeSpan.FromSeconds(.5);
798limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
835var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5);
866limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
923limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5));
Microsoft.Arcade.Common (1)
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (12)
Microsoft.AspNetCore.HeaderParsing.Tests (1)
Microsoft.AspNetCore.Http.Tests (2)
Microsoft.AspNetCore.Identity.FunctionalTests (2)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (9)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
Microsoft.AspNetCore.Session.Tests (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
Microsoft.CodeAnalysis.EditorFeatures (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.Workspaces (1)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.Extensions.AI.Abstractions.Tests (30)
SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (12)
49new("human, ") { ModelId = "model123", StartTime = TimeSpan.FromSeconds(10), EndTime = TimeSpan.FromSeconds(20) },
50new("How ") { ModelId = "model123", StartTime = TimeSpan.FromSeconds(22), EndTime = TimeSpan.FromSeconds(23) },
51new("are ") { ModelId = "model123", StartTime = TimeSpan.FromSeconds(23), EndTime = TimeSpan.FromSeconds(24) },
52new([new TextContent("You?")]) { ModelId = "model123", StartTime = TimeSpan.FromSeconds(24), EndTime = TimeSpan.FromSeconds(25), AdditionalProperties = new() { ["c"] = "d" } },
53new() { ResponseId = "someResponse", ModelId = "model123", StartTime = TimeSpan.FromSeconds(25), EndTime = TimeSpan.FromSeconds(35) },
63Assert.Equal(TimeSpan.FromSeconds(10), response.StartTime);
64Assert.Equal(TimeSpan.FromSeconds(35), response.EndTime);
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (10)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (18)
Microsoft.Extensions.Diagnostics.Probes (1)
Microsoft.Extensions.Diagnostics.Probes.Tests (4)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (3)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (64)
Microsoft.Extensions.Diagnostics.Testing.Tests (9)
Microsoft.Extensions.Hosting.Testing (3)
Microsoft.Extensions.Http.Diagnostics (1)
Microsoft.Extensions.Http.Diagnostics.Tests (22)
Microsoft.Extensions.Http.Resilience (2)
Microsoft.Extensions.Http.Resilience.Tests (35)
Microsoft.Extensions.ServiceDiscovery (3)
Microsoft.Extensions.ServiceDiscovery.Dns (7)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (11)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Microsoft.Extensions.TimeProvider.Testing.Tests (27)
FakeTimeProviderTests.cs (21)
78timeProvider.Advance(TimeSpan.FromSeconds(1));
81Assert.Equal(TimeSpan.FromSeconds(1), t);
89AutoAdvanceAmount = TimeSpan.FromSeconds(1)
96Assert.Equal(TimeSpan.FromSeconds(1), elapsedTime);
97Assert.Equal(TimeSpan.FromSeconds(2), elapsedTime2);
232}, null, TimeSpan.FromSeconds(1), TimeSpan.Zero);
240tp.AdjustTime(tp.GetUtcNow() + TimeSpan.FromSeconds(10));
259}, null, TimeSpan.FromSeconds(1), TimeSpan.Zero);
267tp.AdjustTime(tp.GetUtcNow() - TimeSpan.FromSeconds(10));
375var t = source.Task.WaitAsync(TimeSpan.FromSeconds(100000), timeProvider, CancellationToken.None);
446AutoAdvanceAmount = TimeSpan.FromSeconds(1)
454Assert.Equal(timeProvider.Start + TimeSpan.FromSeconds(1), second);
455Assert.Equal(timeProvider.Start + TimeSpan.FromSeconds(2), third);
473AutoAdvanceAmount = TimeSpan.FromSeconds(1)
485var oneSecond = TimeSpan.FromSeconds(1);
503var provider = new FakeTimeProvider { AutoAdvanceAmount = TimeSpan.FromSeconds(2) };
505using var timer = provider.CreateTimer(calls.Add, "timer-1", TimeSpan.FromSeconds(3), TimeSpan.Zero);
544await provider.Delay(TimeSpan.FromSeconds(taskDelay));
558await provider.Delay(TimeSpan.FromSeconds(delay)).ConfigureAwait(false);
569provider.Advance(TimeSpan.FromSeconds(taskDelay));
572provider.Advance(TimeSpan.FromSeconds(delay));
TimerTests.cs (6)
142Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(-2), TimeSpan.FromSeconds(1)));
144Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(0xFFFFFFFFL), TimeSpan.FromSeconds(1)));
154Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(-2)));
156Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(0xFFFFFFFFL)));
339timers.Add(timeProvider.CreateTimer(index => triggers[(int)index!] = true, i, TimeSpan.FromSeconds(dueTimes[i]), TimeSpan.Zero));
357timeProvider.Advance(TimeSpan.FromSeconds(2));
Microsoft.ML.AutoML (1)
Microsoft.ML.AutoML.Interactive (1)
Microsoft.ML.AutoML.Tests (3)
Microsoft.ML.IntegrationTests (1)
Microsoft.ML.Maml (1)
Microsoft.VisualStudio.LanguageServices (4)
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
Mongo.AppHost (1)
PortableTask (1)
PresentationCore (21)
PresentationFramework (4)
PresentationFramework.Aero (27)
PresentationFramework.Aero2 (27)
Producer (2)
Roslyn.VisualStudio.DiagnosticsWindow (2)
RunTests (1)
ServiceBusWorker (1)
Stress.ApiService (1)
Stress.AppHost (1)
Stress.TelemetryService (1)
System.Diagnostics.DiagnosticSource (1)
System.Diagnostics.Process (1)
System.Formats.Cbor (1)
System.ServiceModel.NetTcp (1)
System.ServiceModel.Primitives (5)
Templates.Blazor.WebAssembly.Auth.Tests (1)
Templates.Blazor.WebAssembly.Tests (1)
Templates.Mvc.Tests (1)
Templates.Tests (1)
UnitTests.Common (9)
VBCSCompiler.UnitTests (1)