Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
fff8f5cb
M
minikube
项目概览
Chu Peng 楚鹏
/
minikube
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
minikube
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fff8f5cb
编写于
9月 17, 2019
作者:
T
Thomas Stromberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Offset integration tests which start clusters by 5s
上级
062c4727
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
34 addition
and
6 deletion
+34
-6
test/integration/addons_test.go
test/integration/addons_test.go
+1
-1
test/integration/docker_test.go
test/integration/docker_test.go
+1
-1
test/integration/guest_env_test.go
test/integration/guest_env_test.go
+1
-1
test/integration/gvisor_addon_test.go
test/integration/gvisor_addon_test.go
+1
-1
test/integration/helpers.go
test/integration/helpers.go
+28
-0
test/integration/start_stop_delete_test.go
test/integration/start_stop_delete_test.go
+1
-1
test/integration/version_upgrade_test.go
test/integration/version_upgrade_test.go
+1
-1
未找到文件。
test/integration/addons_test.go
浏览文件 @
fff8f5cb
...
...
@@ -36,7 +36,7 @@ import (
// TestAddons tests addons that require no special environment -- in parallel
func
TestAddons
(
t
*
testing
.
T
)
{
MaybeParallel
(
t
)
Maybe
Slow
Parallel
(
t
)
profile
:=
UniqueProfileName
(
"addons"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
40
*
time
.
Minute
)
...
...
test/integration/docker_test.go
浏览文件 @
fff8f5cb
...
...
@@ -30,7 +30,7 @@ func TestDockerFlags(t *testing.T) {
if
NoneDriver
()
{
t
.
Skip
(
"skipping: none driver does not support ssh or bundle docker"
)
}
MaybeParallel
(
t
)
Maybe
Slow
Parallel
(
t
)
profile
:=
UniqueProfileName
(
"docker-flags"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
20
*
time
.
Minute
)
...
...
test/integration/guest_env_test.go
浏览文件 @
fff8f5cb
...
...
@@ -27,7 +27,7 @@ import (
)
func
TestGuestEnvironment
(
t
*
testing
.
T
)
{
MaybeParallel
(
t
)
Maybe
Slow
Parallel
(
t
)
profile
:=
UniqueProfileName
(
"guest"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
15
*
time
.
Minute
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
...
...
test/integration/gvisor_addon_test.go
浏览文件 @
fff8f5cb
...
...
@@ -33,7 +33,7 @@ func TestGvisorAddon(t *testing.T) {
if
NoneDriver
()
{
t
.
Skip
(
"Can't run containerd backend with none driver"
)
}
MaybeParallel
(
t
)
Maybe
Slow
Parallel
(
t
)
profile
:=
UniqueProfileName
(
"gvisor"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
20
*
time
.
Minute
)
...
...
test/integration/helpers.go
浏览文件 @
fff8f5cb
...
...
@@ -30,6 +30,7 @@ import (
"io/ioutil"
"os/exec"
"strings"
"sync"
"testing"
"time"
...
...
@@ -40,6 +41,11 @@ import (
"k8s.io/minikube/pkg/kapi"
)
var
(
antiRaceCounter
=
0
antiRaceMutex
=
&
sync
.
Mutex
{}
)
// RunResult stores the result of an cmd.Run call
type
RunResult
struct
{
Stdout
*
bytes
.
Buffer
...
...
@@ -62,6 +68,7 @@ func (rr RunResult) Command() string {
return
sb
.
String
()
}
// Output returns human-readable output for an execution result
func
(
rr
RunResult
)
Output
()
string
{
var
sb
strings
.
Builder
if
rr
.
Stdout
.
Len
()
>
0
{
...
...
@@ -324,6 +331,27 @@ func MaybeParallel(t *testing.T) {
t
.
Parallel
()
}
// MaybeSlowParallel is a terrible workaround for tests which start clusters in a race-filled world
// TODO: Try removing this hack once certificates are deployed per-profile
func
MaybeSlowParallel
(
t
*
testing
.
T
)
{
// NoneDriver shouldn't parallelize "minikube start"
if
NoneDriver
()
{
return
}
antiRaceMutex
.
Lock
()
antiRaceCounter
++
antiRaceMutex
.
Unlock
()
if
antiRaceCounter
>
0
{
// Slow enough to offset start, but not slow to be a major source of delay
penalty
:=
time
.
Duration
(
5
*
antiRaceCounter
)
*
time
.
Second
t
.
Logf
(
"MaybeSlowParallel: Sleeping %s to avoid start race ..."
,
penalty
)
time
.
Sleep
(
penalty
)
}
t
.
Parallel
()
}
// killProcessFamily kills a pid and all of its children
func
killProcessFamily
(
t
*
testing
.
T
,
pid
int
)
{
parent
,
err
:=
process
.
NewProcess
(
int32
(
pid
))
...
...
test/integration/start_stop_delete_test.go
浏览文件 @
fff8f5cb
...
...
@@ -74,7 +74,7 @@ func TestStartStop(t *testing.T) {
for
_
,
tc
:=
range
tests
{
tc
:=
tc
t
.
Run
(
tc
.
name
,
func
(
t
*
testing
.
T
)
{
MaybeParallel
(
t
)
Maybe
Slow
Parallel
(
t
)
if
!
strings
.
Contains
(
tc
.
name
,
"docker"
)
&&
NoneDriver
()
{
t
.
Skipf
(
"skipping %s - incompatible with none driver"
,
t
.
Name
())
...
...
test/integration/version_upgrade_test.go
浏览文件 @
fff8f5cb
...
...
@@ -41,7 +41,7 @@ import (
func
TestVersionUpgrade
(
t
*
testing
.
T
)
{
profile
:=
UniqueProfileName
(
"vupgrade"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
30
*
time
.
Minute
)
MaybeParallel
(
t
)
Maybe
Slow
Parallel
(
t
)
defer
CleanupWithLogs
(
t
,
profile
,
cancel
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录