[jira] [Commented] (CASSANDRA-18152) mockito-inline causes tests to fail beacause o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean

2023-01-16 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17677497#comment-17677497
 ] 

Stefan Miklosovic commented on CASSANDRA-18152:
---

j8 
https://app.circleci.com/pipelines/github/instaclustr/cassandra/1723/workflows/3c868969-abc9-4767-be20-e53bd71aa501
j11 
https://app.circleci.com/pipelines/github/instaclustr/cassandra/1723/workflows/8523d330-ee03-41f2-ade4-a4b970c8e8dc

> mockito-inline causes tests to fail beacause 
> o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean
> ---
>
> Key: CASSANDRA-18152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18152
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest/java
>Reporter: Stefan Miklosovic
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> While working on CASSANDRA-14361, when we included mockito-inline into the 
> build to test the new functionality, unrelated tests in CI started to fail. 
> (1)
> This is happening because mockito, together with stuff which enables static 
> mocking, just does not play together with our way of doing things in dtest 
> framework.
> The workaround is consisting of removing Mockito from InternalNodeProbe, it 
> tries to spy on StorageService to not send any notifications back. This might 
> be workarounded so we do not need Mockito hence tests are fixed and mocking 
> of static methods is possible without any other tests failing.
> (1) 
> https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2168/#showFailuresLink
> see also: [https://github.com/mockito/mockito/issues/2203]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18152) mockito-inline causes tests to fail beacause o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean

2023-01-16 Thread Jira


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17677359#comment-17677359
 ] 

Andres de la Peña commented on CASSANDRA-18152:
---

Changes look good to me, +1

> mockito-inline causes tests to fail beacause 
> o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean
> ---
>
> Key: CASSANDRA-18152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18152
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest/java
>Reporter: Stefan Miklosovic
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> While working on CASSANDRA-14361, when we included mockito-inline into the 
> build to test the new functionality, unrelated tests in CI started to fail. 
> (1)
> This is happening because mockito, together with stuff which enables static 
> mocking, just does not play together with our way of doing things in dtest 
> framework.
> The workaround is consisting of removing Mockito from InternalNodeProbe, it 
> tries to spy on StorageService to not send any notifications back. This might 
> be workarounded so we do not need Mockito hence tests are fixed and mocking 
> of static methods is possible without any other tests failing.
> (1) 
> https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2168/#showFailuresLink
> see also: [https://github.com/mockito/mockito/issues/2203]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18152) mockito-inline causes tests to fail beacause o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean

2023-01-16 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17677357#comment-17677357
 ] 

Stefan Miklosovic commented on CASSANDRA-18152:
---

Thanks [~adelapena] for another review

I will commit it _without_ mockito-inline as it is not necessary in this 
ticket, it will be added in CASSANDRA-14361

this is the branch fully prepared to be merged: 
https://github.com/apache/cassandra/pull/2095/files



> mockito-inline causes tests to fail beacause 
> o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean
> ---
>
> Key: CASSANDRA-18152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18152
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest/java
>Reporter: Stefan Miklosovic
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> While working on CASSANDRA-14361, when we included mockito-inline into the 
> build to test the new functionality, unrelated tests in CI started to fail. 
> (1)
> This is happening because mockito, together with stuff which enables static 
> mocking, just does not play together with our way of doing things in dtest 
> framework.
> The workaround is consisting of removing Mockito from InternalNodeProbe, it 
> tries to spy on StorageService to not send any notifications back. This might 
> be workarounded so we do not need Mockito hence tests are fixed and mocking 
> of static methods is possible without any other tests failing.
> (1) 
> https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2168/#showFailuresLink
> see also: [https://github.com/mockito/mockito/issues/2203]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18152) mockito-inline causes tests to fail beacause o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean

2023-01-15 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17677048#comment-17677048
 ] 

Stefan Miklosovic commented on CASSANDRA-18152:
---

j11 
https://app.circleci.com/pipelines/github/instaclustr/cassandra/1719/workflows/3dd90858-b3bf-49fe-a854-6ed6db11e391
j8 
https://app.circleci.com/pipelines/github/instaclustr/cassandra/1719/workflows/46b93541-8515-4e24-ade9-f820f09a6f23

https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2198/#showFailuresLink

> mockito-inline causes tests to fail beacause 
> o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean
> ---
>
> Key: CASSANDRA-18152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18152
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest/java
>Reporter: Stefan Miklosovic
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> While working on CASSANDRA-14361, when we included mockito-inline into the 
> build to test the new functionality, unrelated tests in CI started to fail. 
> (1)
> This is happening because mockito, together with stuff which enables static 
> mocking, just does not play together with our way of doing things in dtest 
> framework.
> The workaround is consisting of removing Mockito from InternalNodeProbe, it 
> tries to spy on StorageService to not send any notifications back. This might 
> be workarounded so we do not need Mockito hence tests are fixed and mocking 
> of static methods is possible without any other tests failing.
> (1) 
> https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2168/#showFailuresLink
> see also: [https://github.com/mockito/mockito/issues/2203]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18152) mockito-inline causes tests to fail beacause o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean

2023-01-13 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17676806#comment-17676806
 ] 

Stefan Miklosovic commented on CASSANDRA-18152:
---

[~adelapena] thanks for the review, I have reworked it so we do not need to 
have system property.

> mockito-inline causes tests to fail beacause 
> o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean
> ---
>
> Key: CASSANDRA-18152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18152
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest/java
>Reporter: Stefan Miklosovic
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 3h
>  Remaining Estimate: 0h
>
> While working on CASSANDRA-14361, when we included mockito-inline into the 
> build to test the new functionality, unrelated tests in CI started to fail. 
> (1)
> This is happening because mockito, together with stuff which enables static 
> mocking, just does not play together with our way of doing things in dtest 
> framework.
> The workaround is consisting of removing Mockito from InternalNodeProbe, it 
> tries to spy on StorageService to not send any notifications back. This might 
> be workarounded so we do not need Mockito hence tests are fixed and mocking 
> of static methods is possible without any other tests failing.
> (1) 
> https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2168/#showFailuresLink
> see also: [https://github.com/mockito/mockito/issues/2203]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18152) mockito-inline causes tests to fail beacause o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean

2023-01-13 Thread Ekaterina Dimitrova (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17676727#comment-17676727
 ] 

Ekaterina Dimitrova commented on CASSANDRA-18152:
-

Thank you for the ping and the testing, appreciate it! The branch you took is 
already a bit old and WIP but I think it should serve your needs. I can confirm 
that I updated some time ago mockito-core to latest version in trunk and that 
version officially supports Java 17.

I haven't used mockito-inline and when I write in Google mockito-inline Java 17 
support, it took me to this page that discusses an issue people reported in 
2021 and the maintainers confirming they are testing in CI mockito-inline so 
_my guess_ is that it should be fine, but I didn't spend too much time in 
researching. It is important not just to test but also to verify that the 
maintainers of our dependencies are supporting or planning soon to support 
newer JDK versions. Hope that helps.

> mockito-inline causes tests to fail beacause 
> o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean
> ---
>
> Key: CASSANDRA-18152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18152
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest/java
>Reporter: Stefan Miklosovic
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> While working on CASSANDRA-14361, when we included mockito-inline into the 
> build to test the new functionality, unrelated tests in CI started to fail. 
> (1)
> This is happening because mockito, together with stuff which enables static 
> mocking, just does not play together with our way of doing things in dtest 
> framework.
> The workaround is consisting of removing Mockito from InternalNodeProbe, it 
> tries to spy on StorageService to not send any notifications back. This might 
> be workarounded so we do not need Mockito hence tests are fixed and mocking 
> of static methods is possible without any other tests failing.
> (1) 
> https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2168/#showFailuresLink
> see also: [https://github.com/mockito/mockito/issues/2203]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18152) mockito-inline causes tests to fail beacause o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean

2023-01-13 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17676577#comment-17676577
 ] 

Stefan Miklosovic commented on CASSANDRA-18152:
---

I was asked on the mailing list here (0) if this will work with Java 17. 

I have verified that it is possible to mock static methods with mockito 4.7.0 
and mockito-inline 4.7.0 in Java 17 in this branch (1). This branch is using 
the work from CASSANDRA-16895 where I took this branch (2) where upgrade to 
Java 17 is done and I rebased it on top of the current trunk. Then, I 
cherry-picked the work in (3) on top of this rebased branch with Java 17 
support. The cherry-picked commit from CASSANDRA-14361 contains the test which 
is using static methods. I was running the test case SimpleSeedProviderTest 
which is using mocking of static methods and the test passed.

The branch where the solution to remove the dependency on Mockito in 
InternalNodeProbe is here (4) and its build is here (5).

Java I was on: 
{code:java}
$ java -version
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
{code}

Letting [~edimitrova] know I did this as well as [~adelapena] that this is 
available for review so we are unblocked on CASSANDRA-14361 and I am letting 
know [~jlewandowski] that this test was conducted.

(0) https://lists.apache.org/thread/t35wmq90zcfoorjz5dtz6dxt99d5sp6o
(1) [https://github.com/instaclustr/cassandra/tree/CASSANDRA-16895-stefan]
(2) [https://github.com/ekaterinadimitrova2/cassandra/tree/16895-trunk-sept]
(3) [https://issues.apache.org/jira/browse/CASSANDRA-14361]
(4) [https://github.com/apache/cassandra/pull/2095]
(5) 
[https://app.circleci.com/pipelines/github/instaclustr/cassandra?branch=CASSANDRA-18152]

> mockito-inline causes tests to fail beacause 
> o.a.c.distributed.mock.nodetool.InternalNodeProbe spies on StorageServiceMBean
> ---
>
> Key: CASSANDRA-18152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18152
> Project: Cassandra
>  Issue Type: Bug
>  Components: Test/dtest/java
>Reporter: Stefan Miklosovic
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> While working on CASSANDRA-14361, when we included mockito-inline into the 
> build to test the new functionality, unrelated tests in CI started to fail. 
> (1)
> This is happening because mockito, together with stuff which enables static 
> mocking, just does not play together with our way of doing things in dtest 
> framework.
> The workaround is consisting of removing Mockito from InternalNodeProbe, it 
> tries to spy on StorageService to not send any notifications back. This might 
> be workarounded so we do not need Mockito hence tests are fixed and mocking 
> of static methods is possible without any other tests failing.
> (1) 
> https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2168/#showFailuresLink
> see also: [https://github.com/mockito/mockito/issues/2203]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org