milvus/internal
Eng Zer Jun 5375161777
test: use T.TempDir to create temporary test directory (#16758)
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Fixes: #16759
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-05-04 11:35:50 +08:00
..
allocator Refine log level in data (#15821) 2022-03-02 15:35:55 +08:00
common Fix datarace between GetComponentStates and Register (#11935) 2021-11-19 13:57:12 +08:00
core Merge utils/Utils.h into common/Utils.h (#16762) 2022-05-03 12:05:50 +08:00
datacoord Fix bug: wrong metrics name and forget to register metrics (#16714) 2022-04-29 15:35:47 +08:00
datanode Fix Compact Entity ttl param (#16665) 2022-04-28 11:51:47 +08:00
distributed Implements remaining rest APIs (#16387) 2022-04-29 15:15:47 +08:00
indexcoord Add log for getting IndexNode's mertrics (#16747) 2022-04-29 19:07:47 +08:00
indexnode Support easylogging config for segcore and knowhere (#16751) 2022-05-03 08:39:49 +08:00
kv test: use T.TempDir to create temporary test directory (#16758) 2022-05-04 11:35:50 +08:00
log test: use T.TempDir to create temporary test directory (#16758) 2022-05-04 11:35:50 +08:00
metrics Fix bug: wrong metrics name and forget to register metrics (#16714) 2022-04-29 15:35:47 +08:00
mq test: use T.TempDir to create temporary test directory (#16758) 2022-05-04 11:35:50 +08:00
proto Fix miss segments/DmChannel when query by nodeID (#16719) 2022-04-29 14:11:47 +08:00
proxy Enable dimension check in Proxy when create index request received (#16718) 2022-04-29 18:01:49 +08:00
querycoord Add unit test for case of failed to sync segments to shard leader (#16712) 2022-04-29 15:51:49 +08:00
querynode Support easylogging config for segcore and knowhere (#16751) 2022-05-03 08:39:49 +08:00
rootcoord Support string type in segcore (#16546) 2022-04-29 13:35:49 +08:00
storage Benchmark go/cgo parquet payload readers (#16736) 2022-04-29 15:59:47 +08:00
tso Add prometheus metrics for RootCoord (#15684) 2022-03-02 21:11:57 +08:00
types Add SyncReplicaSegments interface for QueryNode (#16672) 2022-04-27 10:41:46 +08:00
util Support easylogging config for segcore and knowhere (#16751) 2022-05-03 08:39:49 +08:00