From 4f823851e2d820a28acfc0d3c60a800c882f5ce9 Mon Sep 17 00:00:00 2001 From: shiniao Date: Tue, 29 Dec 2020 17:27:45 +0800 Subject: [PATCH] 'make bench' excluded the effect of test on the results (#205) * Refactored Save function for config * Refactored Save function for config * 'make bench' excluded the effect of test on the results --- Makefile | 2 +- flock/flock_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f491106..ed48863 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ profile: build @go test -cpuprofile cpu.prof -memprofile mem.prof -v -bench . bench: build - @go test -v -benchmem -bench=. . + @go test -v -run=XXX -benchmem -bench=. . mocks: @mockery -all -case underscore -output ./internal/mocks -recursive diff --git a/flock/flock_test.go b/flock/flock_test.go index b074952..e68fd4e 100644 --- a/flock/flock_test.go +++ b/flock/flock_test.go @@ -12,9 +12,9 @@ import ( const testLockPath = "/tmp/bitcask_unit_test_lock" // file path to use for the lock func TestTryLock(t *testing.T) { - // test that basic locking functionnalities are consistent + // test that basic locking functionalities are consistent - // make sure there is no present lock when startng this test + // make sure there is no present lock when starting this test os.Remove(testLockPath) assert := assert.New(t) @@ -48,7 +48,7 @@ func TestTryLock(t *testing.T) { func TestLock(t *testing.T) { assert := assert.New(t) - // make sure there is no present lock when startng this test + // make sure there is no present lock when starting this test os.Remove(testLockPath) syncChan := make(chan bool) @@ -96,7 +96,7 @@ func TestErrorConditions(t *testing.T) { // -- setup assert := assert.New(t) - // make sure there is no present lock when startng this test + // make sure there is no present lock when starting this test os.Remove(testLockPath) lock := New(testLockPath)