Skip to content

Commit

Permalink
[ML] Fix failing JobUpdateTests.testMergeWithJob test (#99571) (#99574)
Browse files Browse the repository at this point in the history
Ensure that a random compatible _MlConfigVersion_ is used to set the job
version.
  • Loading branch information
edsavage authored Sep 14, 2023
1 parent ef2b116 commit 5196f81
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
package org.elasticsearch.xpack.core.ml.job.config;

import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.test.AbstractXContentSerializingTestCase;
import org.elasticsearch.test.VersionUtils;
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.xpack.core.ml.MlConfigVersion;
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot;
Expand Down Expand Up @@ -293,7 +291,7 @@ public void testMergeWithJob() {
updateBuilder.setPerPartitionCategorizationConfig(new PerPartitionCategorizationConfig(true, randomBoolean()));
updateBuilder.setCustomSettings(customSettings);
updateBuilder.setModelSnapshotId(randomAlphaOfLength(10));
updateBuilder.setJobVersion(MlConfigVersion.fromVersion(VersionUtils.randomCompatibleVersion(random(), Version.CURRENT)));
updateBuilder.setJobVersion(MlConfigVersionUtils.randomCompatibleVersion(random()));
updateBuilder.setModelPruneWindow(TimeValue.timeValueDays(randomIntBetween(1, 100)));
JobUpdate update = updateBuilder.build();

Expand Down

0 comments on commit 5196f81

Please sign in to comment.