mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/mergeset: detect whether we are in test by executable suffix
This commit is contained in:
parent
d2ed8cb0b2
commit
3304dc1e85
2 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@ package mergeset
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
|
@ -146,7 +147,9 @@ func (ib *inmemoryBlock) MarshalUnsortedData(sb *storageBlock, firstItemDst, com
|
|||
return ib.marshalData(sb, firstItemDst, commonPrefixDst, compressLevel)
|
||||
}
|
||||
|
||||
var isInTest bool
|
||||
var isInTest = func() bool {
|
||||
return strings.HasSuffix(os.Args[0], ".test")
|
||||
}()
|
||||
|
||||
// MarshalUnsortedData marshals sorted items from ib to sb.
|
||||
//
|
||||
|
|
|
@ -11,7 +11,6 @@ import (
|
|||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
isInTest = true
|
||||
n := m.Run()
|
||||
os.Exit(n)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue