Skip to content

Commit aed9525

Browse files
committed
Delete jobs created in integration test
(cherry picked from commit 806788f)
1 parent 812e32f commit aed9525

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/Tests/XPack/MachineLearning/PutJob/PutJobApiTests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ public PutJobApiTests(MachineLearningCluster cluster, EndpointUsage usage) : bas
4646
results_index_name = "server-metrics"
4747
};
4848

49+
protected override void IntegrationTeardown(IElasticClient client, CallUniqueValues values)
50+
{
51+
foreach (var value in values)
52+
{
53+
var response = DeleteJob(client, value.Value);
54+
if (!response.IsValid)
55+
throw new Exception($"Problem in integration teardown {response.DebugInformation}");
56+
}
57+
}
58+
4959
protected override int ExpectStatusCode => 200;
5060

5161
protected override Func<PutJobDescriptor<Metric>, IPutJobRequest> Fluent => f => f
@@ -206,6 +216,16 @@ public PutJobWithCustomRulesApiTests(MachineLearningCluster cluster, EndpointUsa
206216

207217
protected override int ExpectStatusCode => 200;
208218

219+
protected override void IntegrationTeardown(IElasticClient client, CallUniqueValues values)
220+
{
221+
foreach (var value in values)
222+
{
223+
var response = DeleteJob(client, value.Value);
224+
if (!response.IsValid)
225+
throw new Exception($"Problem in integration teardown {response.DebugInformation}");
226+
}
227+
}
228+
209229
protected override Func<PutJobDescriptor<Metric>, IPutJobRequest> Fluent => f => f
210230
.Description("Lab 1 - Simple example")
211231
.ResultsIndexName("server-metrics")

0 commit comments

Comments
 (0)