ckb icon indicating copy to clipboard operation
ckb copied to clipboard

Unit tests and Integration tests do not clean up temporary files

Open eval-exec opened this issue 2 years ago • 2 comments

Bug Report

When make test and make integration finished, there are many temporary dirs created by ckb exists in TMPDIR.

Current Behavior

Expected Behavior

I expect temporary files created by unit tests and integration tests should be cleaned up.

Environment

  • CKB version: latest develop branch
  • Chain: /
  • Operating system: NixOS 23.11
  • Arch: x64
  • Installation: Built from source

Additional context/Screenshots

This bug can reproduced by these steps:

mkdir /tmp/ckb_integration_test
export TMPDIR=/tmp/ckb_integration_test
make integration
# ...
# after make integration finish.  there are many temporary files created by integration test exists
❯ ls /tmp/ckb_integration_test/
 ckb-it-BlockSyncDuplicatedAndReconnect-net-uTXWNX             ckb-it-GetBlockFilterHashes-net-WrFZMk
 ckb-it-BlockSyncNonAncestorBestBlocks-net-DlHaBN              ckb-it-GetBlockFilters-net-BWcRPK
 ckb-it-BlockSyncOrphanBlocks-net-zZyivE                       ckb-it-GetBlockFiltersNotReachBatch-net-E6d6Nt
 ckb-it-BlockSyncRelayerCollaboration-net-koWF3K               ckb-it-GetBlocksTimeout-net-7292x1
 ckb-it-BlockTransactionsRelayParentOfOrphanBlock-net-gADiyy   ckb-it-HeaderSyncCycle-net-nh3SUA
 ckb-it-CompactBlockEmpty-net-0mnHuF                           ckb-it-InvalidLocatorSize-net-ngAWP3
 ckb-it-CompactBlockEmptyParentUnknown-net-kSbUtY              ckb-it-LastCommonHeaderForPeerWithWorseChain-net-0fPqAX
 ckb-it-CompactBlockLoseGetBlockTransactions-net-GvEHtP        ckb-it-MalformedMessage-net-gLGwqk
 ckb-it-CompactBlockMissingFreshTxs-net-2LLVdx                 ckb-it-MalformedMessageWithWhitelist-net-j4usQO
 ckb-it-CompactBlockMissingNotFreshTxs-net-KXXrh9              ckb-it-MissingUncleRequest-net-

...
...

And unit test have same issue:

mkdir /tmp/ckb_unit_test
export TMPDIR=/tmp/ckb_unit_test
make test
# ...
# after make test finish.  there are many temporary files created by integration test exists
❯ ls /tmp/ckb_unit_test/
 ckb-tmp-0cbhKs   ckb-tmp-c817WZ   ckb-tmp-H8Dndr   ckb-tmp-mjeZRA   ckb-tmp-omZCMf   ckb-tmp-UBezHw   ckb-tmp-ySywRL
 ckb-tmp-0Fw1AB   ckb-tmp-cTYvUD   ckb-tmp-HHEqzd   ckb-tmp-MOzYHI   ckb-tmp-P9rxMW   ckb-tmp-UIbdzL   ckb-tmp-z9Kpmw

...
...

eval-exec avatar Oct 07 '23 09:10 eval-exec