Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-8124

unit test to ensure that error strings do not change (used in client API)

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: techdebt-backlog
    • Component/s: storage-engine
    • Security Level: Public
    • Labels:
      None
    • Environment:
      any couchbase server, client SDK like Java

      Description

      Currently the Java SDK at least (and probably others) just passes on error strings from ep-engine to the end user (in Java client, via a getMessage() method on OperationStatus object, for example). In java client this is the only way to get what kind of error happened (e.g., if an add() operation fails, was it tmp oom error, or item already exists? or server is down? only way to know is look at the string from getMessage()).

      Implies that the error string reported by ep-engine is part of the API, currently. Ideally all clients would have error code enumerations, and error strings could be improved over time. But until that is in place, and the current string-oriented error checking is deprecated, we should not change the error strings or risk breaking application code in subtle ways upon server upgrades.

      To ensure that error strings do not change without taking the API-breakage into account, we should have a unit test that ensures that checks the error messages explicitly. And that unit test should be well-commented to ensure that engineer doesn't just modify the strings and the test case without understanding why the tests exist in the first place.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        ingenthr Matt Ingenthron added a comment - - edited

        See also JCBC-206 and SPY-117.

        Show
        ingenthr Matt Ingenthron added a comment - - edited See also JCBC-206 and SPY-117 .
        Hide
        cihan Cihan Biyikoglu added a comment -

        Maria, could your team implement this?

        Show
        cihan Cihan Biyikoglu added a comment - Maria, could your team implement this?
        Hide
        maria Maria McDuff (Inactive) added a comment -

        Andrei,

        pls add a test for the Java SDK client (2.0 and 1.4)
        thanks.

        Show
        maria Maria McDuff (Inactive) added a comment - Andrei, pls add a test for the Java SDK client (2.0 and 1.4) thanks.
        Hide
        ingenthr Matt Ingenthron added a comment -

        Note that they may be expected to change in 2.0 (as it's a major version)

        Show
        ingenthr Matt Ingenthron added a comment - Note that they may be expected to change in 2.0 (as it's a major version)

          People

          • Assignee:
            andreibaranouski Andrei Baranouski
            Reporter:
            TimSmith Tim Smith (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 8h
              8h
              Remaining:
              Remaining Estimate - 8h
              8h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Gerrit Reviews

                There are no open Gerrit changes