Skip to content

Commit 9ffb3a3

Browse files
increase cancelling time (dotnet#7207)
1 parent 6d1f7e2 commit 9ffb3a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/Microsoft.ML.AutoML.Tests/AutoMLExperimentTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ public async Task AutoMLExperiment_return_current_best_trial_when_ct_is_canceled
148148
res.Metric.Should().BeGreaterThan(0);
149149
}
150150

151-
//https://github.com/dotnet/machinelearning/issues/7203
152-
[X86X64Fact("Fails on Linux Arm machines")]
151+
[Fact]
153152
public async Task AutoMLExperiment_finish_training_when_time_is_up_Async()
154153
{
155154
var context = new MLContext(1);
@@ -167,12 +166,12 @@ public async Task AutoMLExperiment_finish_training_when_time_is_up_Async()
167166
{
168167
var channel = serviceProvider.GetService<IChannel>();
169168
var settings = serviceProvider.GetService<AutoMLExperiment.AutoMLExperimentSettings>();
170-
return new DummyTrialRunner(settings, 0, channel);
169+
return new DummyTrialRunner(settings, 1, channel);
171170
})
172171
.SetTuner<RandomSearchTuner>();
173172

174173
var cts = new CancellationTokenSource();
175-
cts.CancelAfter(10 * 1000);
174+
cts.CancelAfter(100 * 1000);
176175

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

0 commit comments

Comments
 (0)