Skip to content

Commit 77df2b9

Browse files
authored
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
1 parent a693da3 commit 77df2b9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/Tests.Domain/Project.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public class Metadata
195195

196196
public class ProjectTransform
197197
{
198-
public double AverageCommits { get; set; }
198+
public double? AverageCommits { get; set; }
199199

200200
public long WeekStartedOn { get; set; }
201201

tests/Tests/XPack/Transform/TransformApiTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ public TransformApiTests(WritableCluster cluster, EndpointUsage usage) : base(ne
233233
{
234234
StopTransformStep, u =>
235235
u.Calls<StopTransformDescriptor, StopTransformRequest, IStopTransformRequest, StopTransformResponse>(
236-
v => new StopTransformRequest(v),
237-
(v, d) => d,
236+
v => new StopTransformRequest(v) { Force = true, WaitForCompletion = true },
237+
(v, d) => d.Force().WaitForCompletion(),
238238
(v, c, f) => c.Transform.Stop(v, f),
239239
(v, c, f) => c.Transform.StopAsync(v, f),
240240
(v, c, r) => c.Transform.Stop(r),

0 commit comments

Comments
 (0)