Fix test assertions that depend on undefined row ordering#3007
Open
clayly wants to merge 2 commits intoeclipse-hawkbit:masterfrom
Open
Fix test assertions that depend on undefined row ordering#3007clayly wants to merge 2 commits intoeclipse-hawkbit:masterfrom
clayly wants to merge 2 commits intoeclipse-hawkbit:masterfrom
Conversation
Several tests use containsExactly() or index-based comparison on query results that have no ORDER BY clause. SQL does not guarantee row ordering without explicit ORDER BY, and databases like YugabyteDB return results in a different (but valid) order than PostgreSQL/H2. These tests verify set membership (correct targets assigned, correct actions stored), not ordering. Changed to order-independent assertions: - AutoAssignTest: containsExactly -> containsExactlyInAnyOrder - ControllerManagementTest: index-based loop -> containsExactlyInAnyOrderElementsOf - TargetFilterQueryManagementTest: containsExactly -> containsExactlyInAnyOrder Verified passing on H2 (default) and YugabyteDB (PostgreSQL-compatible).
|
Thanks @clayly for taking the time to contribute to hawkBit! We really appreciate this. Make yourself comfortable while I'm looking for a committer to help you with your contribution. |
Author
|
Hi everyone! Main purpose of such PR is to make it more easy to adapt hawkbit for other Postgres-compatible DB's. Also looks like eclipsedfn/eca check succeeds now for me, do i need to recreate PR? |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Several integration tests use order-sensitive assertions (
containsExactly, index-based access) on query results from queries with noORDER BYclause. SQL does not guarantee row ordering without explicitORDER BY, and this causes deterministic test failures on databases that don't return rows in insertion order (e.g. YugabyteDB, CockroachDB, or any distributed PostgreSQL-compatible DB).The tests verify set membership (correct targets assigned, correct actions stored), not ordering. Changed to order-independent assertions:
containsExactly→containsExactlyInAnyOrderonfindByAssignedDistributionSet()resultscontainsExactlyInAnyOrderElementsOfcontainsExactly→containsExactlyInAnyOrderinverifyExpectedFilterQueriesInListhelpersTest plan