diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-07-20 09:08:21 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-07-20 09:56:19 +0300 |
commit | 974cf6a450f8f36bd6b7f73c534a952196b879d2 (patch) | |
tree | 11956ffcef0bd6236afa5df0a84fa836b04dd9f4 /internal/praefect/transaction_test.go | |
parent | f8f38f43a8ad0f5825161b1da5e13a2eb6e75377 (diff) |
transactions: Do not return state when cancelling
The transaction state is currently returned whenever one calls the
transaction cleanup function. This is an artifact caused by the
transaction type not being publicly visible earlier, but it starts to
become a hinderance when implementing new features and querying
transacton state. So let's just stop returning the state from the
cleanup function and ask callers to retrieve the state by themselves.
Diffstat (limited to 'internal/praefect/transaction_test.go')
-rw-r--r-- | internal/praefect/transaction_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/praefect/transaction_test.go b/internal/praefect/transaction_test.go index eb22067cf..9f927cbd1 100644 --- a/internal/praefect/transaction_test.go +++ b/internal/praefect/transaction_test.go @@ -543,7 +543,8 @@ func TestTransactionWithMultipleVotes(t *testing.T) { wg.Wait() - results, _ := cancel() + require.NoError(t, cancel()) + results := transaction.State() for i, voter := range tc.voters { require.Equal(t, voter.shouldSucceed, results[fmt.Sprintf("node-%d", i)]) } @@ -672,9 +673,9 @@ func TestTransactionCancellation(t *testing.T) { } wg.Wait() - results, err := cancelTransaction() - require.NoError(t, err) + require.NoError(t, cancelTransaction()) + results := transaction.State() for i, v := range tc.voters { require.Equal(t, results[fmt.Sprintf("node-%d", i)], v.shouldSucceed, "result mismatches expected node state") } |