### CI Link

https://gradle-enterprise.elastic.co/s/7dleq35dp5stm

### Repro line

./gradlew ':x-pack:plugin:core:test' --tests "org.elasticsearch.xpack.core.ilm.SetSingleNodeAllocateStepTests.testPerformActionAttrsRequestFails" -Dtests.seed=6B438F3C3DADE5D2 -Dtests.locale=nl -Dtests.timezone=Asia/Chongqin

### Does it reproduce?

Yes

### Applicable branches

8.1, 8.0

### Failure history

Seems to fail rarely, but has failed before. Example: https://gradle-enterprise.elastic.co/s/d33b4fzn7yoh6

### Failure excerpt

```
org.elasticsearch.xpack.core.ilm.SetSingleNodeAllocateStepTests > testPerformActionAttrsRequestFails FAILED
    java.lang.AssertionError: Node roles must not be provided as attributes but saw attributes {ml=K}
        at __randomizedtesting.SeedInfo.seed([C679BACC1DA27FA7:CB16887322D9C088]:0)
        at org.elasticsearch.cluster.node.DiscoveryNode.<init>(DiscoveryNode.java:233)
        at org.elasticsearch.cluster.node.DiscoveryNode.<init>(DiscoveryNode.java:175)
```
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SetSingleNodeAllocateStepTests.java
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.routing.IndexRoutingTable;
import org.elasticsearch.cluster.routing.RoutingTable;
import org.elasticsearch.cluster.routing.ShardRoutingState;
import org.elasticsearch.cluster.routing.TestShardRouting;
import org.elasticsearch.common.collect.ImmutableOpenMap;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.Settings.Builder;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.node.Node;
import org.elasticsearch.test.VersionUtils;
import org.elasticsearch.xpack.core.ilm.Step.StepKey;
import org.mockito.Mockito;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
public class SetSingleNodeAllocateStepTests extends AbstractStepTestCase<SetSingleNodeAllocateStep> {