MapStore2
MapStore2 copied to clipboard
geosolutions-it#10175: fix 2 services search test nondeterminism
Description
Apparently, which search service observable emits results first does not depend on the order in which they are passed into the search. The test however assumed there to be an order, causing it to break on MacOS.
New version:
- sets a different priority for the services
- accepts results from either file in the first emitted result action
- only accepts results from the file with higher priority in the second result action
Relevant source lines in the search epic:
// merge all results from the streams
.mergeAll()
.scan((oldRes, newRes) => sortBy([...oldRes, ...newRes], ["__PRIORITY__"]))
What kind of change does this PR introduce?
- [x] Bugfix
Issue
What is the current behavior?
#10175
What is the new behavior?
Tests run through regardless of OS.
Breaking change
Does this PR introduce a breaking change?
- [x] No