Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #12884] Fix Flaky Behavior in NewMetadataSelector Tests #12885

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down Expand Up @@ -92,6 +92,7 @@ public void testNewIpSelector() {
@Test
public void testNewMetadataSelector() {
Instance ins1 = new Instance();
ins1.setMetadata(new LinkedHashMap<>());
ins1.addMetadata("a", "1");
ins1.addMetadata("b", "2");
Instance ins2 = new Instance();
Expand All @@ -102,7 +103,7 @@ public void testNewMetadataSelector() {
NamingContext namingContext = mock(NamingContext.class);
when(namingContext.getInstances()).thenReturn(Arrays.asList(ins1, ins2, ins3));

NamingSelector metadataSelector = NamingSelectorFactory.newMetadataSelector(new HashMap() {
NamingSelector metadataSelector = NamingSelectorFactory.newMetadataSelector(new LinkedHashMap() {
{
put("a", "1");
put("b", "2");
Expand All @@ -117,6 +118,7 @@ public void testNewMetadataSelector() {
@Test
public void testNewMetadataSelector2() {
Instance ins1 = new Instance();
ins1.setMetadata(new LinkedHashMap<>());
ins1.addMetadata("a", "1");
ins1.addMetadata("c", "3");
Instance ins2 = new Instance();
Expand All @@ -127,7 +129,7 @@ public void testNewMetadataSelector2() {
NamingContext namingContext = mock(NamingContext.class);
when(namingContext.getInstances()).thenReturn(Arrays.asList(ins1, ins2, ins3));

NamingSelector metadataSelector = NamingSelectorFactory.newMetadataSelector(new HashMap() {
NamingSelector metadataSelector = NamingSelectorFactory.newMetadataSelector(new LinkedHashMap() {
{
put("a", "1");
put("b", "2");
Expand Down
Loading