typedb / typedb-driver

TypeDB Drivers for Rust, Python, Java, Node.js, C, C++, and C#.
https://typedb.com
Apache License 2.0
39 stars 33 forks source link

Intermittently failing test that has 2 checks for erroring transactions in quick succession #233

Open alexjpwalker opened 3 years ago

alexjpwalker commented 3 years ago

Problem to Solve

The scenario:

Scenario: uncommitted transaction writes are not persisted
    When graql define
      """
      define dog sub entity;
      """
    When session opens transaction of type: read
    Then graql match; throws exception
      """
      match $x type dog;
      """

intermittently hangs for 10 seconds in Clients Java and NodeJS, and throws an error in Client Python. This error occurs in the tear-down steps - not any of the actual scenario steps.

It's not currently clear why it occurs. It always passes in Core, but causes issues in all of our clients.

Current Workaround

We ignore the test and accept that, occasionally, errors in concurrent transactions will cause clients to hang for a few seconds.

Proposed Solution

We should look into what's really going on and ensure that the error is propagated and managed gracefully.

alexjpwalker commented 1 year ago

After retesting this with Client Java, I haven't observed any occurrences of this issue in 20 reruns.

We should re-enable the test, and retest Client Python.

It's also quite likely that issues like this will dissolve when we make the clients wrap the Rust Client via FFI/JNI.