Skip to content

Commit

Permalink
[ML][TEST] Fix bucket count assertion in all tests in ModelPlotsIT (#…
Browse files Browse the repository at this point in the history
…31026)

This fixes the last remaining test that was missed in #30717.

Closes #30715
  • Loading branch information
dimitris-athanasiou committed Jun 1, 2018
1 parent b1cd8a3 commit 0794d4a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ public void testByFieldWithTerms() throws Exception {
startDatafeed(datafeedId, 0, System.currentTimeMillis());
waitUntilJobIsClosed(job.getId());

assertThat(getBuckets(job.getId()).size(), equalTo(23));
// As the initial time is random, there's a chance the first record is
// aligned on a bucket start. Thus we check the buckets are in [23, 24]
assertThat(getBuckets(job.getId()).size(), greaterThanOrEqualTo(23));
assertThat(getBuckets(job.getId()).size(), lessThanOrEqualTo(24));

Set<String> modelPlotTerms = modelPlotTerms(job.getId(), "by_field_value");
assertThat(modelPlotTerms, containsInAnyOrder("user_2", "user_3"));
}
Expand Down

0 comments on commit 0794d4a

Please sign in to comment.