Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cucumber tests] delete unused test life cycle callbacks #1851

Conversation

trantienduchn
Copy link

I checked, the beforeAll and afterAll callback don't affect any at all to setup cassandra containers startup or shutdown. Cassandra container starting is triggered by another tricky method call. It's DockerCassandraRule.getHost(), it will automatically starting cassandra container by trigger static code block of DockerCassandraSingleton . start() & stop() methods from DockerCassandraRule don't reach to DockerCassandraSingleton but getHost() does. Here is the code of DockerCassandraRule:

public class DockerCassandraRule implements TestRule {
    ...
    public void start() {}     // doesn't reach to DockerCassandraSingleton.singleton to trigger static method
    public void stop() {}     // doesn't reach to DockerCassandraSingleton.singleton to trigger static method
    public Host getHost() {
        return DockerCassandraSingleton.singleton.getHost(); // triger static block execution
    } 
   ....
}

Here is the code of DockerCassandraSingleton:

public class DockerCassandraSingleton {
    public static final DockerCassandra singleton = new DockerCassandra();
    static {
        singleton.start();   // when some statements reach to DockerCassandraSingleton, then static block will be triggered
    }
    ....
}

If I was right. This PR will be green

I checked, the beforeAll and afterAll callback don't affect any at all to setup cassandra containers startup. The cassandra container starting is triggered by another tricky method call. It's DockerCassandraRule.getHost(), it will automatically start DockerCassandraSingleton by trigger static method call.
@trantienduchn trantienduchn added this to the polish_2018_10 milestone Oct 25, 2018
@trantienduchn
Copy link
Author

trantienduchn commented Oct 25, 2018

Starting docker cassandra here is implicit, I would like to make it being more explicit by calling start() method instead of getHost(). Will be addressed in next commit

@rouazana
Copy link

nice catch!

[309accbf10a97cc0d138a3db5ece5c5ff566c877] [ERROR] Errors: 
[309accbf10a97cc0d138a3db5ece5c5ff566c877] [ERROR]   RabbitMQClusterTest$ClusterSharing.queuesShouldBeDeclarableOnAnotherNode:145 » IO
[309accbf10a97cc0d138a3db5ece5c5ff566c877] [ERROR]   RabbitMQClusterTest$ClusterSharing.queuesShouldBeShared » Completion org.rnort...
[309accbf10a97cc0d138a3db5ece5c5ff566c877] [ERROR]   RabbitMQClusterTest$ClusterSharing.rabbitMQManagerShouldReturnThreeNodesWhenAskingForStatus » Completion

test this please

@trantienduchn
Copy link
Author

test this please, rabbit cluster test again

@trantienduchn
Copy link
Author

[c0eaa5cb607c99ea686025bf3ebff612c29a8c1c] [ERROR] Errors: 
[c0eaa5cb607c99ea686025bf3ebff612c29a8c1c] [ERROR]   SpamAssassinContract.imapCopiesToSpamMailboxShouldBeConsideredAsSpam:183 » ConditionTimeout
[c0eaa5cb607c99ea686025bf3ebff612c29a8c1c] [INFO] 
[c0eaa5cb607c99ea686025bf3ebff612c29a8c1c] [ERROR] Tests run: 654, Failures: 0, Errors: 1, Skipped: 1

test this plese

@trantienduchn
Copy link
Author

test this please

@chibenwa
Copy link
Member

Merged

@chibenwa chibenwa closed this Oct 29, 2018
quantranhong1999 pushed a commit to quantranhong1999/james-project that referenced this pull request Dec 14, 2023
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Jan 10, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Jan 11, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Jan 11, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Jan 11, 2024
Arsnael pushed a commit to Arsnael/james-project that referenced this pull request Mar 20, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Apr 14, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Apr 16, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Jun 25, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Jun 25, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Jun 26, 2024
Arsnael pushed a commit to Arsnael/james-project that referenced this pull request Jun 28, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Oct 24, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Nov 20, 2024
vttranlina pushed a commit to vttranlina/james-project that referenced this pull request Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants