mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-24 09:24:09 +01:00
skip timing-sensitive tests on CircleCI
We had too many spurious test failures in the past. But on a developer machine, the tests don't usually fail because the system isn't loaded as much. So, only disable test on CircleCI.
This commit is contained in:
parent
c6a9ebc71c
commit
c600cc1f60
@ -14,11 +14,12 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/zrepl/zrepl/daemon/logging/trace"
|
"github.com/zrepl/zrepl/daemon/logging/trace"
|
||||||
|
"github.com/zrepl/zrepl/util/zreplcircleci"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FIXME: this test relies on timing and is thus rather flaky
|
|
||||||
// (relies on scheduler responsiveness of < 500ms)
|
|
||||||
func TestPqNotconcurrent(t *testing.T) {
|
func TestPqNotconcurrent(t *testing.T) {
|
||||||
|
zreplcircleci.SkipOnCircleCI(t, "because it relies on scheduler responsiveness < 500ms")
|
||||||
|
|
||||||
ctx, end := trace.WithTaskFromStack(context.Background())
|
ctx, end := trace.WithTaskFromStack(context.Background())
|
||||||
defer end()
|
defer end()
|
||||||
var ctr uint32
|
var ctr uint32
|
||||||
@ -90,6 +91,8 @@ func (r record) String() string {
|
|||||||
// Hence, perform some statistics on the wakeup times and assert that the mean wakeup
|
// Hence, perform some statistics on the wakeup times and assert that the mean wakeup
|
||||||
// times for each step are close together.
|
// times for each step are close together.
|
||||||
func TestPqConcurrent(t *testing.T) {
|
func TestPqConcurrent(t *testing.T) {
|
||||||
|
zreplcircleci.SkipOnCircleCI(t, "because it relies on scheduler responsiveness < 500ms")
|
||||||
|
|
||||||
ctx, end := trace.WithTaskFromStack(context.Background())
|
ctx, end := trace.WithTaskFromStack(context.Background())
|
||||||
defer end()
|
defer end()
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/zrepl/zrepl/util/socketpair"
|
"github.com/zrepl/zrepl/util/socketpair"
|
||||||
|
"github.com/zrepl/zrepl/util/zreplcircleci"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestReadTimeout(t *testing.T) {
|
func TestReadTimeout(t *testing.T) {
|
||||||
@ -81,6 +82,8 @@ func TestWriteTimeout(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNoPartialReadsDueToDeadline(t *testing.T) {
|
func TestNoPartialReadsDueToDeadline(t *testing.T) {
|
||||||
|
zreplcircleci.SkipOnCircleCI(t, "needs predictable low scheduling latency")
|
||||||
|
|
||||||
a, b, err := socketpair.SocketPair()
|
a, b, err := socketpair.SocketPair()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer a.Close()
|
defer a.Close()
|
||||||
|
13
util/zreplcircleci/zreplcircleci.go
Normal file
13
util/zreplcircleci/zreplcircleci.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package zreplcircleci
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func SkipOnCircleCI(t *testing.T, reasonFmt string, args ...interface{}) {
|
||||||
|
if os.Getenv("CIRCLECI") != "" {
|
||||||
|
t.Skipf("This test is skipped in CircleCI. Reason: %s", fmt.Sprintf(reasonFmt, args...))
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user