You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "enjoy-binbin (via GitHub)" <gi...@apache.org> on 2023/03/22 03:57:13 UTC

[GitHub] [incubator-kvrocks] enjoy-binbin opened a new pull request, #1343: Clean up files before and after running go tests

enjoy-binbin opened a new pull request, #1343:
URL: https://github.com/apache/incubator-kvrocks/pull/1343

   We currently do not clean up temporary files generated
   by tests, This causes the workspace directory to become
   larger and larger until `No space left` appears, like:
   ```
   --- FAIL: TestString (11.14s)
       --- FAIL: TestString/SETBIT/GETBIT/BITCOUNT/BITPOS_boundary_check_(type_string) (5.71s)
           strings_test.go:360:
                   Error Trace:    /root/kvrocks/incubator-kvrocks/tests/gocase/unit/type/strings/strings_test.go:360
                   Error:          Received unexpected error:
                                   ERR IO error: No space left on device: While appending to file: /root/xxx/gocase/workspace/TestString-xxx/db/000010.log: No space left on device
   ```
   
   An example of consumption:
   ```
   [root@ incubator-kvrocks]# du -sh ./tests/gocase/workspace/ -s
   6.3G    ./tests/gocase/workspace/
   ```
   
   This PR adds the cleanup_go_tests function, which will clean
   up the `Test*` in the workspace directory before and after the
   go test. Also added a try-finally to prevent go tests from failing
   midway (e.g. KeyboardInterrupt).
   
   Logs will be output before and after cleaning, examples are:
   ```
   Cleanup go test workspace: /xxx/incubator-kvrocks/tests/gocase/workspace, it may take some time...
   Cleanup go test workspace: /xxx/incubator-kvrocks/tests/gocase/workspace, done.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on pull request #1343: Clean up files before and after running go tests

Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on PR #1343:
URL: https://github.com/apache/incubator-kvrocks/pull/1343#issuecomment-1478895615

   Thanks for your contributing. 
   
   As mentioned by @tisonkun , we already have an option for testing without temp files. And these files are useful when some tests are failed (or when the program crashed).
   
   But feel free to do other improvements : )


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] enjoy-binbin commented on pull request #1343: Clean up files before and after running go tests

Posted by "enjoy-binbin (via GitHub)" <gi...@apache.org>.
enjoy-binbin commented on PR #1343:
URL: https://github.com/apache/incubator-kvrocks/pull/1343#issuecomment-1478907556

   thanks all. i am new to kvrocks, sorry for the NOP PR.
   
   about the `write-and-run-unit-tests` part, i guess i will skip it now (prevent writing bad things), i need some times to get used to the process here.  a simple flag explanation in the README is probably enough for now since we do have a `Running test cases` in this repo's README
   
   agree with points. one thought, is that we might need to set deleteOnExit to true by default? most users do not need to go to debug. Like me, i am new, and just try to play it a while, and it cost a lot of spaces.
   
   thank you for your time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] enjoy-binbin commented on pull request #1343: Clean up files before and after running go tests

Posted by "enjoy-binbin (via GitHub)" <gi...@apache.org>.
enjoy-binbin commented on PR #1343:
URL: https://github.com/apache/incubator-kvrocks/pull/1343#issuecomment-1478894765

   ohh, thanks, i didn't notice it before. (We may need to document this in the docs)...
   If you press ctrl + c in the middle, will it be cleaned up? I tried it and it doesn’t seem to work, if there is an error or ctrl+c in the middle


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun closed pull request #1343: Clean up files before and after running go tests

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun closed pull request #1343: Clean up files before and after running go tests
URL: https://github.com/apache/incubator-kvrocks/pull/1343


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on pull request #1343: Clean up files before and after running go tests

Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on PR #1343:
URL: https://github.com/apache/incubator-kvrocks/pull/1343#issuecomment-1478898510

   > If you press ctrl + c in the middle, will it be cleaned up? I tried it and it doesn’t seem to work, if there is an error or ctrl+c in the middle.
   
   Currently we need to cleanup these files manually (if we really do not need them to debug), but you are welcome to improve it (with regarding to the `deleteOnExit` option, althought I think it is a bit tricky, and maybe not a vital thing).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on pull request #1343: Clean up files before and after running go tests

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1343:
URL: https://github.com/apache/incubator-kvrocks/pull/1343#issuecomment-1478896708

   > We may need to document this in the docs
   
   You're welcome to add a section or new page in https://kvrocks.apache.org/community/contributing/, following https://pingcap.github.io/tidb-dev-guide/get-started/write-and-run-unit-tests.html or other practice.
   
   > will it be cleaned up
   
   That's by design. As @PragmaTwice mentioned, when tests failed, you'd generally when to find the cause, right?
   
   The technical reason is that we register the cleanup func in `defer` which is only called on `runtime.exit`, not fatal (which is the case on `require.xxx` fails.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on pull request #1343: Clean up files before and after running go tests

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1343:
URL: https://github.com/apache/incubator-kvrocks/pull/1343#issuecomment-1478891374

   ```
   ./x.py test go build -deleteOnExit true
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org