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

build: remove the dependency on GNU Parallel for running unit tests #243

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

AmnonHanuhov
Copy link
Contributor

Instead, use gtest-parallel as a bundled script for running both gtest tests and non-gtest tests (such as c_test, for example).

@AmnonHanuhov AmnonHanuhov added the build Build related label Nov 15, 2022
@AmnonHanuhov AmnonHanuhov self-assigned this Nov 15, 2022
@AmnonHanuhov
Copy link
Contributor Author

@rtpro I think that we should add gtest-parallel as a submodule to our repo, instead of what I did in this PR, which is take the files out of their repo and do the modifications we needed. That way we can be up to date with changes they make, as well as make this diff smaller, to represent only what I have added. Thoughts?

@AmnonHanuhov AmnonHanuhov marked this pull request as draft November 15, 2022 04:56
@AmnonHanuhov AmnonHanuhov force-pushed the 122-remove-gnu-parallel-dependency branch from ec99454 to 003cc27 Compare November 19, 2022 16:17
@AmnonHanuhov AmnonHanuhov force-pushed the 122-remove-gnu-parallel-dependency branch 2 times, most recently from 30f8118 to 96e245b Compare December 2, 2022 08:03
@AmnonHanuhov
Copy link
Contributor Author

@ayulas please test make check on your mac machine on this branch

@ayulas
Copy link
Contributor

ayulas commented Dec 3, 2022

im not sure what i need to see. the make check on my mac takes loooong time. i dont see any changes regarding the parallel

@AmnonHanuhov
Copy link
Contributor Author

im not sure what i need to see. the make check on my mac takes loooong time. i dont see any changes regarding the parallel

Is it the build process that is taking long or is it the part where the tests actually begin to run? Can you please try to isolate the two and let me know?

@ayulas
Copy link
Contributor

ayulas commented Dec 3, 2022

im not sure what i need to see. the make check on my mac takes loooong time. i dont see any changes regarding the parallel

Is it the build process that is taking long or is it the part where the tests actually begin to run? Can you please try to isolate the two and let me know?

the build is always very fast on mac... the tests running is almost an hour.... also in main when i run there is on the left side UI passed / failed and what tests are running. in your branch only how many tests to run and how much was completed

@AmnonHanuhov
Copy link
Contributor Author

im not sure what i need to see. the make check on my mac takes loooong time. i dont see any changes regarding the parallel

Is it the build process that is taking long or is it the part where the tests actually begin to run? Can you please try to isolate the two and let me know?

the build is always very fast on mac... the tests running is almost an hour.... also in main when i run there is on the left side UI passed / failed and what tests are running. in your branch only how many tests to run and how much was completed

Regarding feedback on tests: if a test fails it'll show you that in the summary.
Regarding run times: the fact that it takes you over an hour is very strange to me, could be a hardware issue. Can you please try and run make J=1 check or make check_1 to run the tests sequentially and see how it compares to when you're running them in parallel?
@udi-speedb Can you also try and run make check on your machine? Since the results I'm getting are no where near what Ayelet is describing here.

@ayulas
Copy link
Contributor

ayulas commented Dec 3, 2022

im not sure what i need to see. the make check on my mac takes loooong time. i dont see any changes regarding the parallel

Is it the build process that is taking long or is it the part where the tests actually begin to run? Can you please try to isolate the two and let me know?

the build is always very fast on mac... the tests running is almost an hour.... also in main when i run there is on the left side UI passed / failed and what tests are running. in your branch only how many tests to run and how much was completed

Regarding feedback on tests: if a test fails it'll show you that in the summary. Regarding run times: the fact that it takes you over an hour is very strange to me, could be a hardware issue. Can you please try and run make J=1 check or make check_1 to run the tests sequentially and see how it compares to when you're running them in parallel? @udi-speedb Can you also try and run make check on your machine? Since the results I'm getting are no where near what Ayelet is describing here.

its not an hardware issue since my mac is new and fast .
regarding the mac check with j=1 or 16 i tried both. yours branch took longer
and asking udi - udi doesnt have mac and you asked me to check it cause you did changes that related to mac so whats the point udi will test it?

@AmnonHanuhov
Copy link
Contributor Author

im not sure what i need to see. the make check on my mac takes loooong time. i dont see any changes regarding the parallel

Is it the build process that is taking long or is it the part where the tests actually begin to run? Can you please try to isolate the two and let me know?

the build is always very fast on mac... the tests running is almost an hour.... also in main when i run there is on the left side UI passed / failed and what tests are running. in your branch only how many tests to run and how much was completed

Regarding feedback on tests: if a test fails it'll show you that in the summary. Regarding run times: the fact that it takes you over an hour is very strange to me, could be a hardware issue. Can you please try and run make J=1 check or make check_1 to run the tests sequentially and see how it compares to when you're running them in parallel? @udi-speedb Can you also try and run make check on your machine? Since the results I'm getting are no where near what Ayelet is describing here.

its not an hardware issue since my mac is new and fast . regarding the mac check with j=1 or 16 i tried both. yours branch took longer and asking udi - udi doesnt have mac and you asked me to check it cause you did changes that related to mac so whats the point udi will test it?

The changes in this PR are not specific to MacOS. What you are referring to is me saying I need to make modifications to this PR so that it’ll work on MacOS as well, because when I first opened the PR it only worked on Linux. The purpose of this PR is written in the title and the description, hence why I need Udi to test it as well.

@udi-speedb
Copy link
Contributor

time make check on origin/main (after make all, only the time it takes to run the tests):

real	6m52.357s
user	45m10.164s
sys	44m49.061s

And on your branch:

real	6m44.854s
user	47m7.583s
sys	42m45.322s

@udi-speedb
Copy link
Contributor

@AmnonHanuhov - Is that what you have wanted me to do?

@AmnonHanuhov
Copy link
Contributor Author

@RoyBenMoshe Can you also please test this on your Mac and share the results?

@AmnonHanuhov AmnonHanuhov force-pushed the 122-remove-gnu-parallel-dependency branch 4 times, most recently from 7588a74 to 751aba3 Compare December 11, 2022 18:33
@AmnonHanuhov AmnonHanuhov marked this pull request as ready for review December 17, 2022 11:28
@udi-speedb
Copy link
Contributor

I am trying to view the generated log files of the parallel run. I am notified that they may be binary files:
udi@udi-speedb:~/speedb-oss-OTHER$ less /tmp/gtest-parallel-logs/passed/write_unprepared_transaction_test-WriteUnpreparedStressTest_WriteUnpreparedStressTest_ReadYourOwnWriteStress_0-1.log "/tmp/gtest-parallel-logs/passed/write_unprepared_transaction_test-WriteUnpreparedStressTest_WriteUnpreparedStressTest_ReadYourOwnWriteStress_0-1.log" may be a binary file. See it anyway?

@udi-speedb
Copy link
Contributor

I see that there is a folder containing all of the logs for the passed tests.
What other folders may be created?

@udi-speedb
Copy link
Contributor

Is there a timeout on tests that get stuck?

@mrambacher
Copy link
Contributor

I ran the "make check" on both main and this branch on my M1 Mac running Monterey.

  • On the main branch, some of the tests appeared to fail with a timeout. There are also some issues with tests that contain no tests on the Mac (like options_settable_test). Here is the output from main:

Computers / CPU cores / Max jobs to run
1:local / 10 / 10

Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete
ETA: 10103s Left: 11891 AVG: 0.86s local:10/697/100%/0.9s parallel: Warning: This job was killed because it timed out:
parallel: Warning: ./db_bloom_filter_test >& t/log-db_bloom_filter_test || bash -c "cat t/log-db_bloom_filter_test; exit $?"
ETA: 10103s Left: 11890 AVG: 0.86s local:9/698/100%/0.9s parallel: Warning: This job was killed because it timed out:
parallel: Warning: ./deletefile_test >& t/log-deletefile_test || bash -c "cat t/log-deletefile_test; exit $?"
parallel: Warning: This job was killed because it timed out:
parallel: Warning: ./speedb_db_bloom_filter_test >& t/log-speedb_db_bloom_filter_test || bash -c "cat t/log-speedb_db_bloom_filter_test; exit $?"
ETA: 8285s Left: 10893 AVG: 0.83s local:10/1695/100%/0.8s parallel: Warning: This job was killed because it timed out:
parallel: Warning: ./t/run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter >& t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter || bash -c "cat t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter; exit $?"
ETA: 9209s Left: 10771 AVG: 0.88s local:10/1817/100%/0.9s parallel: Warning: This job was killed because it timed out:
parallel: Warning: ./t/run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest; exit $?"
ETA: 9209s Left: 10742 AVG: 0.87s local:10/1846/100%/0.9s parallel: Warning: This job was killed because it timed out:
parallel: Warning: ./t/run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest; exit $?"
ETA: 6377s Left: 9674 AVG: 0.66s local:10/2914/100%/0.7s /bin/bash: ./t/run-db_logical_block_size_cache_test-: No such file or directory
ETA: 4019s Left: 5723 AVG: 0.70s local:9/6865/100%/0.7s /bin/bash: ./t/run-io_posix_test-
: No such file or directory
ETA: 3635s Left: 5286 AVG: 0.70s local:10/7302/100%/0.7s /bin/bash: ./t/run-options_settable_test-: No such file or directory
ETA: 0s Left: 0 AVG: 0.59s local:0/12588/100%/0.6s s
Seq Host Starttime JobRuntime Send Receive Exitval Signal Command
2 : 1671377974.172 600.851 0 0 -1 15 ./db_bloom_filter_test >& t/log-db_bloom_filter_test || bash -c "cat t/log-db_bloom_filter_test; exit $?"
3 : 1671377974.174 600.902 0 0 -1 15 ./deletefile_test >& t/log-deletefile_test || bash -c "cat t/log-deletefile_test; exit $?"
6 : 1671377974.180 600.938 0 0 -1 15 ./speedb_db_bloom_filter_test >& t/log-speedb_db_bloom_filter_test || bash -c "cat t/log-speedb_db_bloom_filter_test; exit $?"
1487 : 1671378782.996 600.187 0 0 -1 15 ./t/run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter >& t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter || bash -c "cat t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter; exit $?"
1584 : 1671378975.959 600.062 0 0 -1 15 ./t/run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest; exit $?"
1585 : 1671378984.581 600.437 0 0 -1 15 ./t/run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest; exit $?"
2922 : 1671379898.676 0.259 0 81 127 0 ./t/run-db_logical_block_size_cache_test-
>& t/log-run-db_logical_block_size_cache_test-* || bash -c "cat t/log-run-db_logical_block_size_cache_test-; exit $?"
6872 : 1671382798.402 0.460 0 62 127 0 ./t/run-io_posix_test-
>& t/log-run-io_posix_test-* || bash -c "cat t/log-run-io_posix_test-; exit $?"
7312 : 1671383083.469 0.321 0 70 127 0 ./t/run-options_settable_test-
>& t/log-run-options_settable_test-* || bash -c "cat t/log-run-options_settable_test-*; exit $?"
make: *** [check_0] Error 1
make check 3281.20s user 1528.93s system 63% cpu 2:06:44.74 total

  • On this branch, the test ran to completion with no errors (meaning it actually did the "check" part and not just the tests. Here is the output from this branch:
  • Generated TARGETS Summary:
  • 7 libs
  • 3 binarys
  • 196 tests
    build_tools/check-sources.sh
    make check 4085.06s user 1700.47s system 65% cpu 2:27:58.81 total

Note that the time was substantially longer in the new code, but this might have been that the tests which timed out actually completed, or it could have been part of the rest of the "make check" pieces.

Also note that the new code does not support "make watch-log" -- just prints and error and "waits"

@AmnonHanuhov
Copy link
Contributor Author

I see that there is a folder containing all of the logs for the passed tests. What other folders may be created?

A folder for the failed tests (if there are any).

@AmnonHanuhov
Copy link
Contributor Author

I ran the "make check" on both main and this branch on my M1 Mac running Monterey.

  • On the main branch, some of the tests appeared to fail with a timeout. There are also some issues with tests that contain no tests on the Mac (like options_settable_test). Here is the output from main:

Computers / CPU cores / Max jobs to run 1:local / 10 / 10

Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete ETA: 10103s Left: 11891 AVG: 0.86s local:10/697/100%/0.9s parallel: Warning: This job was killed because it timed out: parallel: Warning: ./db_bloom_filter_test >& t/log-db_bloom_filter_test || bash -c "cat t/log-db_bloom_filter_test; exit $?" ETA: 10103s Left: 11890 AVG: 0.86s local:9/698/100%/0.9s parallel: Warning: This job was killed because it timed out: parallel: Warning: ./deletefile_test >& t/log-deletefile_test || bash -c "cat t/log-deletefile_test; exit $?" parallel: Warning: This job was killed because it timed out: parallel: Warning: ./speedb_db_bloom_filter_test >& t/log-speedb_db_bloom_filter_test || bash -c "cat t/log-speedb_db_bloom_filter_test; exit $?" ETA: 8285s Left: 10893 AVG: 0.83s local:10/1695/100%/0.8s parallel: Warning: This job was killed because it timed out: parallel: Warning: ./t/run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter >& t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter || bash -c "cat t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter; exit $?" ETA: 9209s Left: 10771 AVG: 0.88s local:10/1817/100%/0.9s parallel: Warning: This job was killed because it timed out: parallel: Warning: ./t/run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest; exit $?" ETA: 9209s Left: 10742 AVG: 0.87s local:10/1846/100%/0.9s parallel: Warning: This job was killed because it timed out: parallel: Warning: ./t/run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest; exit $?" ETA: 6377s Left: 9674 AVG: 0.66s local:10/2914/100%/0.7s /bin/bash: ./t/run-db_logical_block_size_cache_test-: No such file or directory ETA: 4019s Left: 5723 AVG: 0.70s local:9/6865/100%/0.7s /bin/bash: ./t/run-io_posix_test-: No such file or directory ETA: 3635s Left: 5286 AVG: 0.70s local:10/7302/100%/0.7s /bin/bash: ./t/run-options_settable_test-: No such file or directory ETA: 0s Left: 0 AVG: 0.59s local:0/12588/100%/0.6s s Seq Host Starttime JobRuntime Send Receive Exitval Signal Command 2 : 1671377974.172 600.851 0 0 -1 15 ./db_bloom_filter_test >& t/log-db_bloom_filter_test || bash -c "cat t/log-db_bloom_filter_test; exit $?" 3 : 1671377974.174 600.902 0 0 -1 15 ./deletefile_test >& t/log-deletefile_test || bash -c "cat t/log-deletefile_test; exit $?" 6 : 1671377974.180 600.938 0 0 -1 15 ./speedb_db_bloom_filter_test >& t/log-speedb_db_bloom_filter_test || bash -c "cat t/log-speedb_db_bloom_filter_test; exit $?" 1487 : 1671378782.996 600.187 0 0 -1 15 ./t/run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter >& t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter || bash -c "cat t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter; exit $?" 1584 : 1671378975.959 600.062 0 0 -1 15 ./t/run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest; exit $?" 1585 : 1671378984.581 600.437 0 0 -1 15 ./t/run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest; exit $?" 2922 : 1671379898.676 0.259 0 81 127 0 ./t/run-db_logical_block_size_cache_test- >& t/log-run-db_logical_block_size_cache_test-* || bash -c "cat t/log-run-db_logical_block_size_cache_test-; exit $?" 6872 : 1671382798.402 0.460 0 62 127 0 ./t/run-io_posix_test- >& t/log-run-io_posix_test-* || bash -c "cat t/log-run-io_posix_test-; exit $?" 7312 : 1671383083.469 0.321 0 70 127 0 ./t/run-options_settable_test- >& t/log-run-options_settable_test-* || bash -c "cat t/log-run-options_settable_test-*; exit $?" make: *** [check_0] Error 1 make check 3281.20s user 1528.93s system 63% cpu 2:06:44.74 total

  • On this branch, the test ran to completion with no errors (meaning it actually did the "check" part and not just the tests. Here is the output from this branch:
  • Generated TARGETS Summary:
  • 7 libs
  • 3 binarys
  • 196 tests
    build_tools/check-sources.sh
    make check 4085.06s user 1700.47s system 65% cpu 2:27:58.81 total

Note that the time was substantially longer in the new code, but this might have been that the tests which timed out actually completed, or it could have been part of the rest of the "make check" pieces.

Also note that the new code does not support "make watch-log" -- just prints and error and "waits"

I have experienced the same outcome on my Mac now, I'm pretty sure the difference is due to the failed tests.
Prior to that (when the tests weren't failing) I got pretty much the same time results for both GNU Parallel and gtest-parallel.

Regarding make watch-log, gtest-parallel does show the progress but it outputs the logs to different files (a file per test suite I'm pretty sure), unlike GNU Parallel, how do we want make watch-log to behave in this case?

@AmnonHanuhov
Copy link
Contributor Author

I ran the "make check" on both main and this branch on my M1 Mac running Monterey.

  • On the main branch, some of the tests appeared to fail with a timeout. There are also some issues with tests that contain no tests on the Mac (like options_settable_test). Here is the output from main:

Computers / CPU cores / Max jobs to run 1:local / 10 / 10
Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete ETA: 10103s Left: 11891 AVG: 0.86s local:10/697/100%/0.9s parallel: Warning: This job was killed because it timed out: parallel: Warning: ./db_bloom_filter_test >& t/log-db_bloom_filter_test || bash -c "cat t/log-db_bloom_filter_test; exit ?"ETA:10103sLeft:11890AVG:0.86slocal:9/698/100?" parallel: Warning: This job was killed because it timed out: parallel: Warning: ./speedb_db_bloom_filter_test >& t/log-speedb_db_bloom_filter_test || bash -c "cat t/log-speedb_db_bloom_filter_test; exit ?"ETA:8285sLeft:10893AVG:0.83slocal:10/1695/100?" ETA: 9209s Left: 10771 AVG: 0.88s local:10/1817/100%/0.9s parallel: Warning: This job was killed because it timed out: parallel: Warning: ./t/run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest; exit ?"ETA:9209sLeft:10742AVG:0.87slocal:10/1846/100?" ETA: 6377s Left: 9674 AVG: 0.66s local:10/2914/100%/0.7s /bin/bash: ./t/run-db_logical_block_size_cache_test-: No such file or directory ETA: 4019s Left: 5723 AVG: 0.70s local:9/6865/100%/0.7s /bin/bash: ./t/run-io_posix_test-: No such file or directory ETA: 3635s Left: 5286 AVG: 0.70s local:10/7302/100%/0.7s /bin/bash: ./t/run-options_settable_test-: No such file or directory ETA: 0s Left: 0 AVG: 0.59s local:0/12588/100%/0.6s s Seq Host Starttime JobRuntime Send Receive Exitval Signal Command 2 : 1671377974.172 600.851 0 0 -1 15 ./db_bloom_filter_test >& t/log-db_bloom_filter_test || bash -c "cat t/log-db_bloom_filter_test; exit $?" 3 : 1671377974.174 600.902 0 0 -1 15 ./deletefile_test >& t/log-deletefile_test || bash -c "cat t/log-deletefile_test; exit $?" 6 : 1671377974.180 600.938 0 0 -1 15 ./speedb_db_bloom_filter_test >& t/log-speedb_db_bloom_filter_test || bash -c "cat t/log-speedb_db_bloom_filter_test; exit $?" 1487 : 1671378782.996 600.187 0 0 -1 15 ./t/run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter >& t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter || bash -c "cat t/log-run-db_compaction_filter_test-DBTestCompactionFilter.CompactionFilter; exit $?" 1584 : 1671378975.959 600.062 0 0 -1 15 ./t/run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateLevelSubCompactionTest; exit $?" 1585 : 1671378984.581 600.437 0 0 -1 15 ./t/run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest >& t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest || bash -c "cat t/log-run-db_compaction_test-DBCompactionTest.UpdateUniversalSubCompactionTest; exit $?" 2922 : 1671379898.676 0.259 0 81 127 0 ./t/run-db_logical_block_size_cache_test- >& t/log-run-db_logical_block_size_cache_test-* || bash -c "cat t/log-run-db_logical_block_size_cache_test-; exit $?" 6872 : 1671382798.402 0.460 0 62 127 0 ./t/run-io_posix_test- >& t/log-run-io_posix_test-* || bash -c "cat t/log-run-io_posix_test-; exit $?" 7312 : 1671383083.469 0.321 0 70 127 0 ./t/run-options_settable_test- >& t/log-run-options_settable_test-* || bash -c "cat t/log-run-options_settable_test-*; exit $?" make: *** [check_0] Error 1 make check 3281.20s user 1528.93s system 63% cpu 2:06:44.74 total

  • On this branch, the test ran to completion with no errors (meaning it actually did the "check" part and not just the tests. Here is the output from this branch:
  • Generated TARGETS Summary:
  • 7 libs
  • 3 binarys
  • 196 tests
    build_tools/check-sources.sh
    make check 4085.06s user 1700.47s system 65% cpu 2:27:58.81 total

Note that the time was substantially longer in the new code, but this might have been that the tests which timed out actually completed, or it could have been part of the rest of the "make check" pieces.
Also note that the new code does not support "make watch-log" -- just prints and error and "waits"

I have experienced the same outcome on my Mac now, I'm pretty sure the difference is due to the failed tests. Prior to that (when the tests weren't failing) I got pretty much the same time results for both GNU Parallel and gtest-parallel.

Regarding make watch-log, gtest-parallel does show the progress but it outputs the logs to different files (a file per test suite I'm pretty sure), unlike GNU Parallel, how do we want make watch-log to behave in this case?

The way gtest-parallel works is that as long as tests are passing, the output to stdout is of the following format:

[number of tests ran/number of total tests] name of test (time it took to run the test)

if a test fails, the gtest log of that test will be displayed and then gtest-parallel will continue executing and print a line of the above format again, see this gist for an example output.
So we don't really need an equivalent of make watch-log when working with gtest-parallel imo.

@mrambacher
Copy link
Contributor

The way gtest-parallel works is that as long as tests are passing, the output to stdout is of the following format:

[number of tests ran/number of total tests] name of test (time it took to run the test)

if a test fails, the gtest log of that test will be displayed and then gtest-parallel will continue executing and print a line of the above format again, see this gist for an example output. So we don't really need an equivalent of make watch-log when working with gtest-parallel imo.

If "make watch-log" does not work, the rule should be deleted.

Personally, I use "watch-log" to see which (if any tests) have failed so far. The failed tests are listed at the top (I think) and I see which tests have failed. This allows me to abort the test earlier if I see tests that are failing which I do not expect. I do not know if there is anything comparable with gtest-parallel (or ctest for that matter).

@AmnonHanuhov AmnonHanuhov force-pushed the 122-remove-gnu-parallel-dependency branch from 751aba3 to 0ee37ec Compare January 6, 2023 16:41
@AmnonHanuhov
Copy link
Contributor Author

The way gtest-parallel works is that as long as tests are passing, the output to stdout is of the following format:
[number of tests ran/number of total tests] name of test (time it took to run the test)
if a test fails, the gtest log of that test will be displayed and then gtest-parallel will continue executing and print a line of the above format again, see this gist for an example output. So we don't really need an equivalent of make watch-log when working with gtest-parallel imo.

If "make watch-log" does not work, the rule should be deleted.

Personally, I use "watch-log" to see which (if any tests) have failed so far. The failed tests are listed at the top (I think) and I see which tests have failed. This allows me to abort the test earlier if I see tests that are failing which I do not expect. I do not know if there is anything comparable with gtest-parallel (or ctest for that matter).

Deleted the rule. gtest-parallel prints the failed tests in the same window you are running make check from, as well as saving log files for both the failed & passed tests.
From the documentation inside the code of gtest-parallel, regarding their class responsible for outputting the progress of the tests:
"Output transient and permanent lines of text. If several transient
lines are written in sequence, the new will overwrite the old. We
use this to ensure that lots of unimportant info (tests passing)
won't drown out important info (tests failing)."
And you can see an example in the gist I linked in my previous comment.

@udi-speedb udi-speedb removed their request for review January 9, 2023 08:26
Copy link
Contributor

@mrambacher mrambacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AmnonHanuhov
Copy link
Contributor Author

@Yuval-Ariel Can we merge this?

…122)

Instead, use gtest-parallel as a bundled script for running both
gtest tests and non-gtest tests (such as c_test, for example).
@AmnonHanuhov AmnonHanuhov force-pushed the 122-remove-gnu-parallel-dependency branch from 0ee37ec to 386355d Compare January 9, 2023 19:42
@Yuval-Ariel
Copy link
Contributor

how has this been tested?

@mrambacher
Copy link
Contributor

how has this been tested?

@Yuval-Ariel Cannot speak for general testing but I ran this on my Mac and it works better than the original. Performance does not change but the old code had problems with test files that contained no tests.

@Yuval-Ariel
Copy link
Contributor

@AmnonHanuhov ? i want to make sure this does not break anything for existing users using different platforms

@AmnonHanuhov
Copy link
Contributor Author

@AmnonHanuhov ? i want to make sure this does not break anything for existing users using different platforms

This was tested on both Linux and mac, by Udi, myself, and Mark, in both platforms I had no problems running the tests in parallel with gtest-parallel and even saw small improvements in terms of the time it took to run the tests, compared to GNU parallel.
No extra dependencies are required and users with a clone of speedb will be able to use make check "out of the box".

@Yuval-Ariel Yuval-Ariel merged commit 8a81432 into main Jan 17, 2023
@Yuval-Ariel Yuval-Ariel deleted the 122-remove-gnu-parallel-dependency branch May 11, 2023 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build: remove the dependency on GNU Parallel for running unit tests
5 participants