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
0210c3dd
Commit
0210c3dd
authored
Aug 07, 2017
by
Mik Vyatskov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Stackdriver Logging soak tests issues
parent
c75d3028
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
soak.go
test/e2e/instrumentation/logging/stackdrvier/soak.go
+3
-2
logging_agent.go
test/e2e/instrumentation/logging/utils/logging_agent.go
+6
-1
wait.go
test/e2e/instrumentation/logging/utils/wait.go
+7
-7
No files found.
test/e2e/instrumentation/logging/stackdrvier/soak.go
View file @
0210c3dd
...
@@ -84,8 +84,9 @@ var _ = instrumentation.SIGDescribe("Cluster level logging implemented by Stackd
...
@@ -84,8 +84,9 @@ var _ = instrumentation.SIGDescribe("Cluster level logging implemented by Stackd
for
runIdx
:=
0
;
runIdx
<
podRunCount
;
runIdx
++
{
for
runIdx
:=
0
;
runIdx
<
podRunCount
;
runIdx
++
{
// Starting one pod on each node.
// Starting one pod on each node.
for
_
,
pod
:=
range
podsByRun
[
runIdx
]
{
for
_
,
pod
:=
range
podsByRun
[
runIdx
]
{
err
:=
pod
.
Start
(
f
)
if
err
:=
pod
.
Start
(
f
);
err
!=
nil
{
framework
.
Logf
(
"Failed to start pod: %v"
,
err
)
framework
.
Logf
(
"Failed to start pod: %v"
,
err
)
}
}
}
<-
t
.
C
<-
t
.
C
}
}
...
...
test/e2e/instrumentation/logging/utils/logging_agent.go
View file @
0210c3dd
...
@@ -65,7 +65,12 @@ func EnsureLoggingAgentRestartsCount(f *framework.Framework, appName string, max
...
@@ -65,7 +65,12 @@ func EnsureLoggingAgentRestartsCount(f *framework.Framework, appName string, max
maxRestartCount
:=
0
maxRestartCount
:=
0
for
_
,
pod
:=
range
agentPods
.
Items
{
for
_
,
pod
:=
range
agentPods
.
Items
{
restartCount
:=
int
(
pod
.
Status
.
ContainerStatuses
[
0
]
.
RestartCount
)
contStatuses
:=
pod
.
Status
.
ContainerStatuses
if
len
(
contStatuses
)
==
0
{
framework
.
Logf
(
"There are no container statuses for pod %s"
,
pod
.
Name
)
continue
}
restartCount
:=
int
(
contStatuses
[
0
]
.
RestartCount
)
maxRestartCount
=
integer
.
IntMax
(
maxRestartCount
,
restartCount
)
maxRestartCount
=
integer
.
IntMax
(
maxRestartCount
,
restartCount
)
framework
.
Logf
(
"Logging agent %s on node %s was restarted %d times"
,
framework
.
Logf
(
"Logging agent %s on node %s was restarted %d times"
,
...
...
test/e2e/instrumentation/logging/utils/wait.go
View file @
0210c3dd
...
@@ -150,9 +150,6 @@ func getFullIngestionPred(podsMap map[string]FiniteLoggingPod) NumberedIngestion
...
@@ -150,9 +150,6 @@ func getFullIngestionPred(podsMap map[string]FiniteLoggingPod) NumberedIngestion
return
func
(
name
string
,
occ
map
[
int
]
bool
)
(
bool
,
error
)
{
return
func
(
name
string
,
occ
map
[
int
]
bool
)
(
bool
,
error
)
{
p
:=
podsMap
[
name
]
p
:=
podsMap
[
name
]
ok
:=
len
(
occ
)
==
p
.
ExpectedLineCount
()
ok
:=
len
(
occ
)
==
p
.
ExpectedLineCount
()
if
!
ok
{
framework
.
Logf
(
"Pod %s is still missing %d lines"
,
name
,
p
.
ExpectedLineCount
()
-
len
(
occ
))
}
return
ok
,
nil
return
ok
,
nil
}
}
}
}
...
@@ -160,24 +157,27 @@ func getFullIngestionPred(podsMap map[string]FiniteLoggingPod) NumberedIngestion
...
@@ -160,24 +157,27 @@ func getFullIngestionPred(podsMap map[string]FiniteLoggingPod) NumberedIngestion
func
getFullIngestionTimeout
(
podsMap
map
[
string
]
FiniteLoggingPod
,
slack
float64
)
NumberedTimeoutFun
{
func
getFullIngestionTimeout
(
podsMap
map
[
string
]
FiniteLoggingPod
,
slack
float64
)
NumberedTimeoutFun
{
return
func
(
names
[]
string
,
occs
map
[
string
]
map
[
int
]
bool
)
error
{
return
func
(
names
[]
string
,
occs
map
[
string
]
map
[
int
]
bool
)
error
{
totalGot
,
totalWant
:=
0
,
0
totalGot
,
totalWant
:=
0
,
0
podsWithLosse
s
:=
[]
string
{}
lossMsg
s
:=
[]
string
{}
for
_
,
name
:=
range
names
{
for
_
,
name
:=
range
names
{
got
:=
len
(
occs
[
name
])
got
:=
len
(
occs
[
name
])
want
:=
podsMap
[
name
]
.
ExpectedLineCount
()
want
:=
podsMap
[
name
]
.
ExpectedLineCount
()
if
got
!=
want
{
if
got
!=
want
{
podsWithLosses
=
append
(
podsWithLosses
,
name
)
lossMsg
:=
fmt
.
Sprintf
(
"%s: %d lines"
,
name
,
want
-
got
)
lossMsgs
=
append
(
lossMsgs
,
lossMsg
)
}
}
totalGot
+=
got
totalGot
+=
got
totalWant
+=
want
totalWant
+=
want
}
}
if
len
(
podsWithLosse
s
)
>
0
{
if
len
(
lossMsg
s
)
>
0
{
framework
.
Logf
(
"Still missing logs from:
%s"
,
strings
.
Join
(
podsWithLosses
,
",
"
))
framework
.
Logf
(
"Still missing logs from:
\n
%s"
,
strings
.
Join
(
lossMsgs
,
"
\n
"
))
}
}
lostFrac
:=
1
-
float64
(
totalGot
)
/
float64
(
totalWant
)
lostFrac
:=
1
-
float64
(
totalGot
)
/
float64
(
totalWant
)
if
lostFrac
>
slack
{
if
lostFrac
>
slack
{
return
fmt
.
Errorf
(
"still missing %.2f%% of logs, only %.2f%% is tolerable"
,
return
fmt
.
Errorf
(
"still missing %.2f%% of logs, only %.2f%% is tolerable"
,
lostFrac
*
100
,
slack
*
100
)
lostFrac
*
100
,
slack
*
100
)
}
}
framework
.
Logf
(
"Missing %.2f%% of logs, which is lower than the threshold %.2f%%"
,
lostFrac
*
100
,
slack
*
100
)
return
nil
return
nil
}
}
}
}
...
...
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