cynara: fix tcag10_cancel_request test that sometimes failed 60/315760/2
authorKrzysztof Malysa <k.malysa@samsung.com>
Wed, 4 Dec 2024 12:01:25 +0000 (13:01 +0100)
committerKrzysztof Małysa <k.malysa@samsung.com>
Mon, 9 Dec 2024 08:46:04 +0000 (08:46 +0000)
Change-Id: Iaf45697cd3d255fa1461d46cfec7686e5a8309d6

src/cynara-tests/test_cases_agent.cpp

index dc3a67565e071eb30f309bdd2cf2eb109f99e53e..67c06c05464a7a94dcf9e69ea263666d693a7d64 100644 (file)
@@ -282,8 +282,12 @@ void tcag10_cancel_request_func()
                          std::ref(agent), std::ref(agentRequest), std::ref(client),
                          CYNARA_API_SUCCESS, Timeout::ExpectMode::TIMEOUT);
     agentRequest.assertCancel();
+    // The above call to getAgentRequest() calls client.process() to send CancelRequest. However,
+    // the client.process() may or might not receive CancelResponse because server immediately
+    // responds with CancelResponse (does not wait for agent response).
+    // On the client side, we cannot determine whether the CancelResponse was already read or not
+    // because the response callback is called immediately by client.cancel().
     agent.putResponse(AgentResponse::createCancel(id));
-    client.process(CYNARA_API_SUCCESS, Client::TimeoutExpectation::EXPECT_NO_TIMEOUT, 2);
 }
 
 void tcag11_cancel_processed_request_func()