Skip to content

Improve error handling in TestKeyAssignment #2337

@kirdatatjana

Description

@kirdatatjana

Problem

The integration test TestKeyAssignment in key_assignment.go has several test cases that use early returns on errors.
Since some test cases expect errors but don't check error types, this means that the tests would fail silently if errors are returned in places other than where the actual expected error is.

Problem details

The following test cases have early returns on errors, which can lead to false positive test results:

  • Double same-key assignment in the same block by different values
  • Double same-key assignment in the same block by the same value
  • Double same-key assignment in different blocks by different values

As a temporary solution, the test cases should panic in the event of an early error. These test cases need to be refactored to use proper error handling and ensure all checks are performed correctly.

An alternative solution could be to add checks for the exact error types or messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: waiting-triageThis issue/PR has not yet been triaged by the team.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions