From 6501497d7c5880bd8c84b44aedd4692a7038c401 Mon Sep 17 00:00:00 2001 From: Russ Cam Date: Fri, 12 Jun 2020 10:50:40 +1000 Subject: [PATCH] Fix flaky TransformApi test (#4771) This commit - Adds force and wait_for_completion to Stop transform, to ensure it is stopped - updates the Project transform type to make AverageCommits a nullable double. Depending on the input parameters to the integration test, this value can be null on the transform for a given date. Fixes #4747 --- tests/Tests.Domain/Project.cs | 2 +- tests/Tests/XPack/Transform/TransformApiTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Tests.Domain/Project.cs b/tests/Tests.Domain/Project.cs index ac586f6e697..d6394ab332a 100644 --- a/tests/Tests.Domain/Project.cs +++ b/tests/Tests.Domain/Project.cs @@ -195,7 +195,7 @@ public class Metadata public class ProjectTransform { - public double AverageCommits { get; set; } + public double? AverageCommits { get; set; } public long WeekStartedOn { get; set; } diff --git a/tests/Tests/XPack/Transform/TransformApiTests.cs b/tests/Tests/XPack/Transform/TransformApiTests.cs index a8fbb98b52c..a32e377bdd0 100644 --- a/tests/Tests/XPack/Transform/TransformApiTests.cs +++ b/tests/Tests/XPack/Transform/TransformApiTests.cs @@ -233,8 +233,8 @@ public TransformApiTests(WritableCluster cluster, EndpointUsage usage) : base(ne { StopTransformStep, u => u.Calls( - v => new StopTransformRequest(v), - (v, d) => d, + v => new StopTransformRequest(v) { Force = true, WaitForCompletion = true }, + (v, d) => d.Force().WaitForCompletion(), (v, c, f) => c.Transform.Stop(v, f), (v, c, f) => c.Transform.StopAsync(v, f), (v, c, r) => c.Transform.Stop(r),