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

Andres de la Peña edited comment on CASSANDRA-18000 at 10/28/22 9:56 AM:
-------------------------------------------------------------------------

{quote}Shaving even a few seconds would be useful bc it will multiply at least 
by 500 now that it will be mandatory
{quote}
Totally agree. Indeed, I think we should also skip dependencies on regular 
tests, not only in the repeated tests. Regular tests are parallelized and run 
with different configs, like JDK, compression, CDC, vnodes, etc. If we multiply 
configs per parallelism, we have hundreds of useless dependency executions that 
we can save us.

The {{no-build-test}} flag was added with the multiplexer to partially 
alleviate this. The problem is that, while it prevents the execution of 
{{{}build-test{}}}, the dependencies of this target are still run.

Analogously, the {{unless="no-checkstyle"}} added to {{{}init-checkstyle{}}}, 
{{checkstyle}} and {{checkstyle}} doesn't prevent the execution of the many 
dependencies of these targets: {{{}validate-build-conf{}}}, {{{}init{}}}, 
{{{}_resolver_download{}}}, {{{}resolver-init{}}}, {{{}write-poms{}}}, 
{{{}resolver-retrieve-build{}}}, {{{}check-gen-cql3-grammar{}}}, etc.

The tests on CircleCI always run after the {{ant jar}} call that is done by the 
build task. So we don't really need to run any of the dependencies of the test 
targets. Although the {{no-build-test}} and {{no-checkstyle}} flags can 
certainly skip most of the heavy work in practice, they still involve a bunch 
of not-so-slow target executions. It would be ideal to get rid of these 
executions.

I don't see anything in Ant to optionally disable all dependency resolving. We 
could add the {{no-build-test}} flag to all the depended on targets, but that 
seems quite invasive. Also, I think we can only have an "unless" condition per 
target, and some targets already depend on other conditions. That's the case 
for example of {{checkstyle}} itself. So we could build env vars with the 
disjunctions of both conditions, like {{{}no-build-test-or-checkstyle{}}}, 
which also seems too complex.

Alternatively, we can add dependency-free versions of the ~10 test targets that 
we use on CI, for example:
{code:java}
<target name="testsome" depends="build-test" description="Execute specific unit 
tests (with dependencies)" >
  <antcall target="testsome-no-deps" />
</target>
<target name="testsome-no-deps" description="Execute specific unit tests  
(without dependencies)" >
  ...run tests here...
</target>
{code}
Those {{{}testsome-no-deps{}}}, {{{}test-compression-no-deps{}}}, 
{{{}test-cdc-no-deps{}}}, etc. would actually avoid all dependencies, saving 
some 6 seconds per run. wdyt?


was (Author: adelapena):
{quote}Shaving even a few seconds would be useful bc it will multiply at least 
by 500 now that it will be mandatory
{quote}
Totally agree. Indeed, I think we should also skip dependencies on regular 
tests, not only in the repeated tests. Regular tests are parallelized and run 
with different configs, like JDK, compression, CDC, vnodes, etc. If we multiply 
configs per parallelism, we have hundreds of useless dependency executions that 
we can save us.

The {{no-build-test}} flag was added with the multiplexer to partially 
alleviate this. The problem is that, while it prevents the execution of 
{{{}build-test{}}}, the dependencies of this target are still run.

Analogously, the {{unless="no-checkstyle"}} added to {{{}init-checkstyle{}}}, 
{{checkstyle}} and {{checkstyle}} doesn't prevent the execution of the many 
dependencies of these targets: {{{}validate-build-conf{}}}, {{{}init{}}}, 
{{{}_resolver_download{}}}, {{{}resolver-init{}}}, {{{}write-poms{}}}, 
{{{}resolver-retrieve-build{}}}, {{{}check-gen-cql3-grammar{}}}, etc.

The tests on CircleCI always run after the {{ant jar}} call that is done by the 
build task. So we don't really need to run any of the dependencies of the test 
targets. Although the {{no-build-test}} and {{no-checkstyle}} flags can 
certainly skip most of the heavy work in practice, they still involve a bunch 
of not-so-slow target executions. It would be ideal to get rid of these 
executions.

I don't see anything in Ant to optionally disable all dependency resolving. We 
could add the {{no-build-test}} flag to all the depended on targets, but that 
seems quite invasive. Also, I think we can only have an "unless" condition per 
target, and some targets already depend on other conditions. That's the case 
for example of {{checkstyle}} itself. So we could build env vars with the 
disjunctions of both conditions, like {{{}no-build-test-or-checkstyle{}}}, 
which also seems too complex.

Alternatively, we can add dependency-free versions of the ~10 test targets that 
we use on CI, for example:
{code:java}
<target name="testsome" depends="build-test" description="Execute specific unit 
tests" >
  <antcall target="testsome-no-deps" />
</target>
<target name="testsome-no-deps" description="Execute specific unit tests" >
  ...run tests here...
</target>
{code}
Those {{{}testsome-no-deps{}}}, {{{}test-compression-no-deps{}}}, 
{{{}test-cdc-no-deps{}}}, etc. would actually avoid all dependencies, saving 
some 6 seconds per run. wdyt?

> CircleCI: Skip checkstyle in the Ant-based repeated tests
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-18000
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18000
>             Project: Cassandra
>          Issue Type: Task
>          Components: CI
>            Reporter: Andres de la Peña
>            Assignee: Andres de la Peña
>            Priority: Normal
>
> The CircleCI jobs for repeating Ant-based tests include the {{checkstyle}} 
> and {{checkstyle-test}} targets. Those targets are skipped for Java 11 but 
> not for Java 8.
> Including those targets on every test iteration produces a significant 
> difference in the run times of repeated test jobs for j8 and j11:
>  * 
> [https://app.circleci.com/pipelines/github/adelapena/cassandra/2328/workflows/122d58b9-b454-4a99-8c46-f7777b7ef225/jobs/23225]
>  * 
> [https://app.circleci.com/pipelines/github/adelapena/cassandra/2328/workflows/50f33d9b-c7c6-4aa9-bac9-22ac78ad6b8c/jobs/23224]
> We should use the {{no-checkstyle}} flag in the iterations done by those 
> jobs. That should significantly speed up the jobs and save resources.
>  
> Thanks to [~bereng] , who detected the difference in the running times 
> between j8 and j11.



--
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

Reply via email to