Skip to content

Commit

Permalink
increase cancelling time (#7207)
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleLittleCloud authored Aug 2, 2024
1 parent 6d1f7e2 commit 9ffb3a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/Microsoft.ML.AutoML.Tests/AutoMLExperimentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ public async Task AutoMLExperiment_return_current_best_trial_when_ct_is_canceled
res.Metric.Should().BeGreaterThan(0);
}

//https://github.com/dotnet/machinelearning/issues/7203
[X86X64Fact("Fails on Linux Arm machines")]
[Fact]
public async Task AutoMLExperiment_finish_training_when_time_is_up_Async()
{
var context = new MLContext(1);
Expand All @@ -167,12 +166,12 @@ public async Task AutoMLExperiment_finish_training_when_time_is_up_Async()
{
var channel = serviceProvider.GetService<IChannel>();
var settings = serviceProvider.GetService<AutoMLExperiment.AutoMLExperimentSettings>();
return new DummyTrialRunner(settings, 0, channel);
return new DummyTrialRunner(settings, 1, channel);
})
.SetTuner<RandomSearchTuner>();

var cts = new CancellationTokenSource();
cts.CancelAfter(10 * 1000);
cts.CancelAfter(100 * 1000);

var res = await experiment.RunAsync(cts.Token);
res.Metric.Should().BeGreaterThan(0);
Expand Down Expand Up @@ -446,6 +445,7 @@ public void Dispose()
public async Task<TrialResult> RunAsync(TrialSettings settings, CancellationToken ct)
{
_logger.Info("Update Running Trial");
ct.ThrowIfCancellationRequested();
await Task.Delay(_finishAfterNSeconds * 1000, ct);
ct.ThrowIfCancellationRequested();
_logger.Info("Update Completed Trial");
Expand Down

0 comments on commit 9ffb3a3

Please sign in to comment.