Skip to content

Commit

Permalink
Merge pull request quarkusio#44027 from AmitPr/nondet-config-properties
Browse files Browse the repository at this point in the history
Fix flaky test due to nondeterministic serialization order
  • Loading branch information
gsmet authored Oct 24, 2024
2 parents 8f7119e + 3b6f2fb commit fc18f96
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.TreeMap;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
Expand All @@ -30,7 +31,8 @@ public String name() {
}

@Override
public void process(Path targetDirectory, String relativePath, List<TargetFile> codestartFiles, Map<String, Object> data)
public void process(Path targetDirectory, String relativePath, List<TargetFile> codestartFiles,
Map<String, Object> data)
throws IOException {
checkNotEmptyCodestartFiles(codestartFiles);

Expand Down Expand Up @@ -63,7 +65,8 @@ private void writeYamlConfig(Path targetPath, Map<String, Object> config) throws

private void writePropertiesConfig(Path targetPath, Map<String, Object> config) throws IOException {
final StringBuilder builder = new StringBuilder();
final HashMap<String, String> flat = new HashMap<>();
// Enforce properties are in consistent order.
final TreeMap<String, String> flat = new TreeMap<>();
flatten("", flat, config);
for (Map.Entry<String, String> entry : flat.entrySet()) {
final String key = entry.getKey().replaceAll("\\.~$", "");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mp.messaging.outgoing.words-out.address=words
mp.messaging.incoming.words-in.address=words
mp.messaging.outgoing.words-out.address=words
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mp.messaging.incoming.words-in.auto.offset.reset=earliest
mp.messaging.incoming.words-in.topic=words
mp.messaging.outgoing.words-out.topic=words
mp.messaging.incoming.words-in.auto.offset.reset=earliest

0 comments on commit fc18f96

Please sign in to comment.