This repository was archived by the owner on Oct 9, 2023. It is now read-only.
Commit a76af4e
authored
Close Transactions Properly (#45)
## What is the goal of this PR?
Properly close transactions that was leading to failing client-python tests, and ensure that tests that are failing clean up properly rather than exiting without closing transactions.
## What are the changes implemented in this PR?
* Exhaust the gRPC iterator when the transaction is closed to ensure that `onCompleted()` is called on the server. Previously, we were emptying the input iterator and adding `None` to its queue, but this was not being consumed. Thus, the transactions was not being cleaned up on the server as the `transaction(stream)` RPC call was never completed cleanly.
* Utilise `addCleanup` to close transactions even if the tests fail - this is always executed regardless of test status.
Closes #441 parent 4410db0 commit a76af4e
File tree
3 files changed
+25
-13
lines changed- grakn/service/Session
- tests/integration
3 files changed
+25
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
| 158 | + | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 83 | + | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
164 | 165 | | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | | - | |
167 | | - | |
| 169 | + | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
0 commit comments