Skip to content

Commit

Permalink
replace conditional compile with skip
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Aug 5, 2021
1 parent 9b698a4 commit 1ea7c19
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 5 additions & 2 deletions owner/fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

package owner

import (
Expand All @@ -21,6 +19,7 @@ import (
"math"
"net"
"os"
"runtime"
"sync"
"testing"
"time"
Expand All @@ -39,6 +38,10 @@ var (
)

func TestFailNewSession(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("integration.NewClusterV3 will create file contains a colon which is not allowed on Windows")
}

_ = os.Remove("new_session:0")
ln, err := net.Listen("unix", "new_session:0")
require.NoError(t, err)
Expand Down
11 changes: 9 additions & 2 deletions owner/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

package owner_test

import (
"context"
"fmt"
"runtime"
"testing"
"time"

Expand All @@ -38,6 +37,10 @@ import (
const testLease = 5 * time.Millisecond

func TestSingle(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("integration.NewClusterV3 will create file contains a colon which is not allowed on Windows")
}

store, err := mockstore.NewMockStore()
require.NoError(t, err)
defer func() {
Expand Down Expand Up @@ -93,6 +96,10 @@ func TestSingle(t *testing.T) {
}

func TestCluster(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("integration.NewClusterV3 will create file contains a colon which is not allowed on Windows")
}

originalTTL := owner.ManagerSessionTTL
owner.ManagerSessionTTL = 3
defer func() {
Expand Down

0 comments on commit 1ea7c19

Please sign in to comment.