node-ottoman icon indicating copy to clipboard operation
node-ottoman copied to clipboard

Ottoman Testing with SDK 4.0

Open AV25242 opened this issue 3 years ago • 2 comments

The plan is to get Ottoman over Node.js SDK 4.1 which will release this month, as a step towards getting Ottoman updated it will be good to start testing Ottoman with SDK 4.0, a release with SDK 4.0 is not recommended at this time, this is just a proactive measure to get us to SDK 4.1 in May.

AV25242 avatar Apr 04 '22 14:04 AV25242

Tested it out with 4.0; everything worked well with a few minor changes:

/src/ottoman/ottoman.ts:

  • removed NoopTracer and NoopMeter from the import statement (from Couchbase)
  • removed lines 241-247, which appears to have been a temporary solution to a segfault that is hopefully fixed in 4.0

/src/couchbase.ts:

  • removed RequestSpan from the exports

Additionally, the connection string parameter to ignore TLS verification was renamed from ssl=no_verify to tls_verify=none in v4.0 (I believe this is due to the change to couchbase++). Connections to TLS-enabled clusters (like Capella) will either need the root certificate passed in with the connection or ?tls_verify=none at the end of the connection string.

I wrote a quick tutorial with a bit more info if needed: https://developer.couchbase.com/tutorial-nodejs-tls-connection

ejscribner avatar Apr 07 '22 23:04 ejscribner

An update after running the test suite against Ottoman built with Node.js SDK 4.0:

Local/On Prem cluster (Docker)

  • Initially I got a few errors claiming certain features were unsupported in my version of Couchbase
  • Pulling the latest image from docker seemed to fix that issue, and all tests passed reliably afterwards

Capella

  • After updating testData.js and jest.setup.ts to accommodate a Capella connection, most tests passed with several exceptions:
    • model-crud.spec.ts
      • In test 'UserModel keyGeneratorDelimiter at Instance Level' a new Ottoman instances is created using a connection string, which is not yet documented for 4.0. This results in an UnambiguousTimeout, See last bullet for more detail.
    • ensure_collections_and_indexes.spec.ts
      • Fails to create bucket, several UnambiguousTimeout, then fails to drop bucket
      • This is likely due to Capella not supporting bucket/scope/collection creation via the SDK on trial clusters (or so I've heard)
      • I have not yet tested on a paid cluster but plan to do so later today once I have access
    • indexes.spec.ts
      • Fails to upsert the design document in Testing indexes
    • errors-name.spec.ts
      • Fails to upsert the design document in Indexes -> BuildIndexQueryError
    • nested-model-key.spec.ts
      • Tests in this file fail intermittently and were only observed once
      • The failures were UnambiguousTimeout and failure to read collections
    • ottoman-instances.spec.ts
      • Several tests from this file fail (UnambiguousTimeout) because it attempts to spawn multiple instances of Ottoman in various ways.
      • For the instance it creates using an object to pass connection params, updating the object params in the instance3.connect() call to match the Capella details fixes the issue.
      • For the instances it creates using a connection string, it appears 4.0 does not currently have documentation for using connection strings (as they changed significantly). See more: https://docs.couchbase.com/nodejs-sdk/current/howtos/managing-connections.html#connection-strings

ejscribner avatar Apr 12 '22 22:04 ejscribner