You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Konstantine Karantasis (Jira)" <ji...@apache.org> on 2020/02/14 00:40:00 UTC

[jira] [Comment Edited] (KAFKA-9446) Integration test library should provide utilities to assert connector state

    [ https://issues.apache.org/jira/browse/KAFKA-9446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17036609#comment-17036609 ] 

Konstantine Karantasis edited comment on KAFKA-9446 at 2/14/20 12:39 AM:
-------------------------------------------------------------------------

This is mostly addressed by: 

[https://github.com/apache/kafka/pull/8055]

Additional methods can be added as needed to the integration utils. 
The class that now contains the assertions and the checks for integration tests is

{{org.apache.kafka.connect.util.clusters.EmbeddedConnectClusterAssertions}}

Given this class contains similar methods to the ones described above, such as:

{code:java}
assertAtLeastNumWorkersAreUp
assertConnectorAndAtLeastNumTasksAreRunning
assertConnectorAndExactlyNumTasksAreRunning
assertConnectorIsRunningAndTasksHaveFailed
assertConnectorAndTasksAreStopped
{code}
and some more, maybe we can close this ticket. 


was (Author: kkonstantine):
This is mostly addressed by: 

[https://github.com/apache/kafka/pull/8055]

Additional methods can be added as needed to the integration utils. 
The class that now contains the assertions and the checks for integration tests is

{{org.apache.kafka.connect.util.clusters.EmbeddedConnectClusterAssertions}}

Given this class contains similar methods to the ones described above, such as:

{code:java}
assertAtLeastNumWorkersAreUp
assertConnectorAndAtLeastNumTasksAreRunning
assertConnectorAndExactlyNumTasksAreRunning
assertConnectorIsRunningAndTasksHaveFailed
{code}
and some more, maybe we can close this ticket. 

> Integration test library should provide utilities to assert connector state
> ---------------------------------------------------------------------------
>
>                 Key: KAFKA-9446
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9446
>             Project: Kafka
>          Issue Type: Improvement
>          Components: KafkaConnect
>            Reporter: Chris Egerton
>            Priority: Minor
>
> The integration testing library for Connect could be expanded to include methods for verifying the state of connectors. Some possibilities are:
>  
> {{public boolean connectorIsRunning(String connector);}}
> {{public boolean connectorIsFailed(String connector);}}
> {{public boolean connectorIsRunningWithTasks(String connector, int numTasks);}}
> {{public boolean connectorIsFailedWithTasksRunning(String connector, int numTasks);}}
> {{public boolean connectorAndTasksAreFailed(String connector, int numTasks);}}
>  
> These could be used in conjunction with the various [waitForCondition|https://github.com/apache/kafka/blob/6d87c12729ac6dc9d39949c931fad4c45c6af841/clients/src/test/java/org/apache/kafka/test/TestUtils.java#L335-L372] methods to easily wait for connectors to be started, failed, etc. during tests.
>  
> Functionality like this is already present in some integration tests, but is implemented on a per-test basis instead of as part of the integration testing library itself.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)