Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
0b184d35
Commit
0b184d35
authored
Feb 18, 2019
by
xichengliudui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixgo lint failures test/integration/...
update pull request update pull request add files update pull request
parent
4938cc37
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
32 deletions
+27
-32
.golint_failures
hack/.golint_failures
+0
-2
BUILD
test/integration/scheduler_perf/BUILD
+0
-1
scheduler_test.go
test/integration/scheduler_perf/scheduler_test.go
+6
-6
util.go
test/integration/scheduler_perf/util.go
+0
-1
attach_detach_test.go
test/integration/volume/attach_detach_test.go
+1
-2
persistent_volumes_test.go
test/integration/volume/persistent_volumes_test.go
+20
-20
No files found.
hack/.golint_failures
View file @
0b184d35
...
...
@@ -706,6 +706,4 @@ test/integration/master
test/integration/replicaset
test/integration/replicationcontroller
test/integration/scheduler
test/integration/scheduler_perf
test/integration/volume
test/utils
test/integration/scheduler_perf/BUILD
View file @
0b184d35
...
...
@@ -14,7 +14,6 @@ go_library(
],
importpath = "k8s.io/kubernetes/test/integration/scheduler_perf",
deps = [
"//pkg/scheduler/algorithmprovider:go_default_library",
"//pkg/scheduler/factory:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
...
...
test/integration/scheduler_perf/scheduler_test.go
View file @
0b184d35
...
...
@@ -130,7 +130,7 @@ func schedulePods(config *testConfig) int32 {
prev
:=
0
// On startup there may be a latent period where NO scheduling occurs (qps = 0).
// We are interested in low scheduling rates (i.e. qps=2),
minQ
ps
:=
int32
(
math
.
MaxInt32
)
minQ
PS
:=
int32
(
math
.
MaxInt32
)
start
:=
time
.
Now
()
// Bake in time for the first pod scheduling event.
for
{
...
...
@@ -167,15 +167,15 @@ func schedulePods(config *testConfig) int32 {
consumed
=
1
}
fmt
.
Printf
(
"Scheduled %v Pods in %v seconds (%v per second on average). min QPS was %v
\n
"
,
config
.
numPods
,
consumed
,
config
.
numPods
/
consumed
,
minQ
ps
)
return
minQ
ps
config
.
numPods
,
consumed
,
config
.
numPods
/
consumed
,
minQ
PS
)
return
minQ
PS
}
// There's no point in printing it for the last iteration, as the value is random
qps
:=
len
(
scheduled
)
-
prev
qpsStats
[
qps
]
+=
1
if
int32
(
qps
)
<
minQ
ps
{
minQ
ps
=
int32
(
qps
)
qpsStats
[
qps
]
++
if
int32
(
qps
)
<
minQ
PS
{
minQ
PS
=
int32
(
qps
)
}
fmt
.
Printf
(
"%ds
\t
rate: %d
\t
total: %d (qps frequency: %v)
\n
"
,
time
.
Since
(
start
)
/
time
.
Second
,
qps
,
len
(
scheduled
),
qpsStats
)
prev
=
len
(
scheduled
)
...
...
test/integration/scheduler_perf/util.go
View file @
0b184d35
...
...
@@ -20,7 +20,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
clientset
"k8s.io/client-go/kubernetes"
restclient
"k8s.io/client-go/rest"
_
"k8s.io/kubernetes/pkg/scheduler/algorithmprovider"
"k8s.io/kubernetes/pkg/scheduler/factory"
"k8s.io/kubernetes/test/integration/util"
)
...
...
test/integration/volume/attach_detach_test.go
View file @
0b184d35
...
...
@@ -350,9 +350,8 @@ func waitToObservePods(t *testing.T, podInformer cache.SharedIndexInformer, podN
objects
:=
podInformer
.
GetIndexer
()
.
List
()
if
len
(
objects
)
==
podNum
{
return
true
,
nil
}
else
{
return
false
,
nil
}
return
false
,
nil
});
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
test/integration/volume/persistent_volumes_test.go
View file @
0b184d35
...
...
@@ -244,7 +244,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
maxClaims
:=
100
claims
:=
[]
*
v1
.
PersistentVolumeClaim
{}
for
counter
<=
maxClaims
{
counter
+=
1
counter
++
newPvc
:=
pvc
.
DeepCopy
()
newPvc
.
ObjectMeta
=
metav1
.
ObjectMeta
{
Name
:
fmt
.
Sprintf
(
"fake-pvc-race-%d"
,
counter
)}
claim
,
err
:=
testClient
.
CoreV1
()
.
PersistentVolumeClaims
(
ns
.
Name
)
.
Create
(
newPvc
)
...
...
@@ -313,19 +313,19 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
modes
=
[]
v1
.
PersistentVolumeAccessMode
{
v1
.
ReadWriteOnce
}
reclaim
=
v1
.
PersistentVolumeReclaimRetain
pv
_t
rue
=
createPV
(
"pv-true"
,
"/tmp/foo-label"
,
"1G"
,
modes
,
reclaim
)
pv
_f
alse
=
createPV
(
"pv-false"
,
"/tmp/foo-label"
,
"1G"
,
modes
,
reclaim
)
pvc
=
createPVC
(
"pvc-ls-1"
,
ns
.
Name
,
"1G"
,
modes
,
""
)
pv
T
rue
=
createPV
(
"pv-true"
,
"/tmp/foo-label"
,
"1G"
,
modes
,
reclaim
)
pv
F
alse
=
createPV
(
"pv-false"
,
"/tmp/foo-label"
,
"1G"
,
modes
,
reclaim
)
pvc
=
createPVC
(
"pvc-ls-1"
,
ns
.
Name
,
"1G"
,
modes
,
""
)
)
pv
_t
rue
.
ObjectMeta
.
SetLabels
(
map
[
string
]
string
{
"foo"
:
"true"
})
pv
_f
alse
.
ObjectMeta
.
SetLabels
(
map
[
string
]
string
{
"foo"
:
"false"
})
pv
T
rue
.
ObjectMeta
.
SetLabels
(
map
[
string
]
string
{
"foo"
:
"true"
})
pv
F
alse
.
ObjectMeta
.
SetLabels
(
map
[
string
]
string
{
"foo"
:
"false"
})
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
_t
rue
)
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
T
rue
)
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to create PersistentVolume: %v"
,
err
)
}
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
_f
alse
)
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
F
alse
)
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to create PersistentVolume: %v"
,
err
)
}
...
...
@@ -394,19 +394,19 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
modes
=
[]
v1
.
PersistentVolumeAccessMode
{
v1
.
ReadWriteOnce
}
reclaim
=
v1
.
PersistentVolumeReclaimRetain
pv
_t
rue
=
createPV
(
"pv-true"
,
"/tmp/foo-label"
,
"1G"
,
modes
,
reclaim
)
pv
_f
alse
=
createPV
(
"pv-false"
,
"/tmp/foo-label"
,
"1G"
,
modes
,
reclaim
)
pvc
=
createPVC
(
"pvc-ls-1"
,
ns
.
Name
,
"1G"
,
modes
,
""
)
pv
T
rue
=
createPV
(
"pv-true"
,
"/tmp/foo-label"
,
"1G"
,
modes
,
reclaim
)
pv
F
alse
=
createPV
(
"pv-false"
,
"/tmp/foo-label"
,
"1G"
,
modes
,
reclaim
)
pvc
=
createPVC
(
"pvc-ls-1"
,
ns
.
Name
,
"1G"
,
modes
,
""
)
)
pv
_t
rue
.
ObjectMeta
.
SetLabels
(
map
[
string
]
string
{
"foo"
:
"valA"
,
"bar"
:
""
})
pv
_f
alse
.
ObjectMeta
.
SetLabels
(
map
[
string
]
string
{
"foo"
:
"valB"
,
"baz"
:
""
})
pv
T
rue
.
ObjectMeta
.
SetLabels
(
map
[
string
]
string
{
"foo"
:
"valA"
,
"bar"
:
""
})
pv
F
alse
.
ObjectMeta
.
SetLabels
(
map
[
string
]
string
{
"foo"
:
"valB"
,
"baz"
:
""
})
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
_t
rue
)
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
T
rue
)
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to create PersistentVolume: %v"
,
err
)
}
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
_f
alse
)
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
F
alse
)
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to create PersistentVolume: %v"
,
err
)
}
...
...
@@ -539,7 +539,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
t
.
Fatalf
(
"Bind mismatch! Expected %s capacity %d but got %s capacity %d"
,
pvc
.
Name
,
expectedCapVal
,
pv
.
Spec
.
ClaimRef
.
Name
,
pvCap
)
}
t
.
Logf
(
"claim bounded to %s capacity %v"
,
pv
.
Name
,
pv
.
Spec
.
Capacity
[
v1
.
ResourceStorage
])
bound
+=
1
bound
++
}
t
.
Log
(
"volumes checked"
)
...
...
@@ -965,18 +965,18 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
defer
close
(
stopCh
)
// This PV will be claimed, released, and deleted
pv
_r
wo
:=
createPV
(
"pv-rwo"
,
"/tmp/foo"
,
"10G"
,
pv
R
wo
:=
createPV
(
"pv-rwo"
,
"/tmp/foo"
,
"10G"
,
[]
v1
.
PersistentVolumeAccessMode
{
v1
.
ReadWriteOnce
},
v1
.
PersistentVolumeReclaimRetain
)
pv
_r
wm
:=
createPV
(
"pv-rwm"
,
"/tmp/bar"
,
"10G"
,
pv
R
wm
:=
createPV
(
"pv-rwm"
,
"/tmp/bar"
,
"10G"
,
[]
v1
.
PersistentVolumeAccessMode
{
v1
.
ReadWriteMany
},
v1
.
PersistentVolumeReclaimRetain
)
pvc
:=
createPVC
(
"pvc-rwm"
,
ns
.
Name
,
"5G"
,
[]
v1
.
PersistentVolumeAccessMode
{
v1
.
ReadWriteMany
},
""
)
_
,
err
:=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
_r
wm
)
_
,
err
:=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
R
wm
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to create PersistentVolume: %v"
,
err
)
}
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
_r
wo
)
_
,
err
=
testClient
.
CoreV1
()
.
PersistentVolumes
()
.
Create
(
pv
R
wo
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to create PersistentVolume: %v"
,
err
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment