Graylog2 / Graylog2/graylog2-server

Use LinkedHashSet for deterministic iterations

Open
#7,608 0 comments 0 reactions 0 assignees View on GitHub
bug triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

Test `everySearchTypeGeneratesOneESQuery` depends on method `run` in `ElasticsearchBackendGeneratedRequestTestBase.java` and assert the results with the functionalities of `resourceFile`. The method `run` depends on the iteration order of the `HashSet`. However, `HashSet` does not guarantee any specific order of entries. Tests can fail if the iteration order changes.
## Expected Behavior
Tests should always pass if no changes made to source code

## Current Behavior
Tests may fail or pass with no changes made to the source code.

## Possible Solution
Changing HashSet to LinkedHashSet that make the iteration order deterministic

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.