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

Extremely long unit tests in eo-runtime #2716

Closed
volodya-lombrozo opened this issue Dec 22, 2023 · 14 comments · Fixed by #2928
Closed

Extremely long unit tests in eo-runtime #2716

volodya-lombrozo opened this issue Dec 22, 2023 · 14 comments · Fixed by #2928
Assignees
Labels
Milestone

Comments

@volodya-lombrozo
Copy link
Member

Unit tests in eo-runtime project run extremely long time:

eo-runtime ......................................... SUCCESS [04:37 min]

I believe 4min for unit test is extremely long. A close look on tests itself shows that only a few tests run so long:

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.382 s - in EOorg.EOeolang.EOtuple_fluent_withTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.607 s - in EOorg.EOeolang.EOrefers_to_inner_vars_correctlyTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.396 s - in EOorg.EOeolang.EOcalculates_only_once_BROKENTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.196 s - in EOorg.EOeolang.EOrecursion_without_argumentsTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.831 s - in EOorg.EOeolang.EOcage_nested_objectsTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.789 s - in EOorg.EOeolang.EOdataizes_encaged_object_lazily_firstTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 25.733 s - in EOorg.EOeolang.EOswitch_simple_caseTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 83.445 s - in EOorg.EOeolang.EOswitch_with_several_true_casesTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 84.961 s - in EOorg.EOeolang.EOswitch_strings_caseTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 102.758 s - in EOorg.EOeolang.EOswitch_complex_caseTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 122.704 s - in EOorg.EOeolang.EOtuple_with_negative_index_gets_firstTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 217.928 s - in EOorg.EOeolang.EOdataizes_encaged_object_lazily_thirdTest

Maybe it makes sense to move this tests to integration tests section, or just optimize the current tests somehow?

@maxonfjvipon
Copy link
Member

The main reason of such long execution is tuple object. It's recursive and extremely slow now. Therefore, all objects that use tuple (for example switch) become slow too

@volodya-lombrozo
Copy link
Member Author

@maxonfjvipon I believe we should do something with it

@volodya-lombrozo
Copy link
Member Author

Maybe we can provide some optimization under the hood.

@l3r8yJ
Copy link
Contributor

l3r8yJ commented Jan 22, 2024

@volodya-lombrozo take a look, please

I just started a build on my laptop and got these results, might be helpful

[INFO] eo ................................................. SUCCESS [  2.829 s]
[INFO] eo-parser .......................................... SUCCESS [ 12.750 s]
[INFO] eo-maven-plugin .................................... SUCCESS [01:03 min]
[INFO] eo-runtime ......................................... SUCCESS [02:20 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:40 min
[INFO] Finished at: 2024-01-22T02:42:34+03:00
[INFO] ------------------------------------------------------------------------

@maxonfjvipon maxonfjvipon added this to the Important milestone Feb 2, 2024
@levBagryansky
Copy link
Member

@volodya-lombrozo I have such results on my machine:

[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 114.9 s -- in EOorg.EOeolang.EOswitch_strings_caseTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 114.7 s -- in EOorg.EOeolang.EOswitch_with_several_true_casesTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 93.24 s -- in EOorg.EOeolang.EOswitch_complex_caseTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 223.7 s -- in EOorg.EOeolang.EOiterating_tuple_with_while_without_body_multipleTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 222.6 s -- in EOorg.EOeolang.EOtuple_with_negative_index_gets_firstTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 247.1 s -- in org.eolang.SnippetTestCase
Hello[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 494.1 s -- in EOorg.EOeolang.EOdataizes_encaged_object_lazily_thirdTest
, world! Several tupled.
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 549.0 s -- in EOorg.EOeolang.EOio.EOtupled_stdout_severalTest

The tests are really long

@levBagryansky
Copy link
Member

@volodya-lombrozo test below takes 47s on my machine.

 #Test
[] > just-long-test
  seq > @
    *
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE

I also added items to it and at the moment it is executing more than hour.

#Test
[] > simple-test
  seq > @
    *
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE
      TRUE

@volodya-lombrozo
Copy link
Member Author

@levBagryansky It's crazy, as for me

@levBagryansky
Copy link
Member

@volodya-lombrozo I figured out how to optimize seq but there are still problems with switch and others.

@maxonfjvipon
Copy link
Member

@levBagryansky tuple is what is needed be optimized

@levBagryansky
Copy link
Member

@maxonfjvipon we cannot since it is implemented in eo

@maxonfjvipon
Copy link
Member

maxonfjvipon commented Feb 27, 2024

@levBagryansky I think we can improve it in EO, at least a little bit

levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 27, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 27, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 27, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 27, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 27, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 27, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 27, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 27, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 28, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 28, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Feb 28, 2024
@levBagryansky
Copy link
Member

Now the org.eolang.SnippetTestCase is the bottleneck in quick passing of tests in eo-runtime.

levBagryansky added a commit to levBagryansky/eo that referenced this issue Mar 7, 2024
levBagryansky added a commit to levBagryansky/eo that referenced this issue Mar 7, 2024
@maxonfjvipon
Copy link
Member

@levBagryansky don't remember, that most of the integration tests are disabled now

@levBagryansky
Copy link
Member

@maxonfjvipon ok

levBagryansky added a commit to levBagryansky/eo that referenced this issue Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants