Skip to content

Commit

Permalink
Set socket connection setup timeout in 0105:do_test_txn_concurrent_op…
Browse files Browse the repository at this point in the history
…erations (#4186)

While using create_txn_producer for any test, we set the socket.connection.setup.timeout.ms to 5s, see a6a5e53 .

However, for this test, we are setting the mock broker's RTT to 5s, and due to the fact that we might make the ApiVersionRequest twice (once with version 3, and then with version 0 when the first one fails), this test fails.

To remedy this, we make the socket.connection.setup.timeout.ms 3*RTT (2* for taking into account the ApiVersionRequest, and the extra 1* for  some buffer)
  • Loading branch information
milindl authored Feb 10, 2023
1 parent 883567a commit 076405e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/0105-transactions_mock.c
Original file line number Diff line number Diff line change
Expand Up @@ -3533,7 +3533,15 @@ static void do_test_txn_concurrent_operations(rd_bool_t do_commit) {

test_timeout_set(90);

rk = create_txn_producer(&mcluster, transactional_id, 1, NULL);
/* We need to override the value of socket.connection.setup.timeout.ms
* to be at least 2*RTT of the mock broker. This is because the first
* ApiVersion request will fail, since we make the request with v3, and
* the mock broker's MaxVersion is 2, so the request is retried with v0.
* We use the value 3*RTT to add some buffer.
*/
rk = create_txn_producer(&mcluster, transactional_id, 1,
"socket.connection.setup.timeout.ms", "15000",
NULL);

/* Set broker RTT to 5s so that the background thread has ample
* time to call its conflicting APIs. */
Expand Down

0 comments on commit 076405e

Please sign in to comment.