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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]