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
c4660222
Commit
c4660222
authored
Mar 17, 2017
by
Mik Vyatskov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loosen requirements of cluster logging e2e tests, make them more stable
parent
223c721d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
15 deletions
+46
-15
cluster_logging_es.go
test/e2e/cluster_logging_es.go
+4
-5
cluster_logging_gcl.go
test/e2e/cluster_logging_gcl.go
+5
-7
cluster_logging_gcl_load.go
test/e2e/cluster_logging_gcl_load.go
+2
-2
cluster_logging_utils.go
test/e2e/cluster_logging_utils.go
+35
-1
No files found.
test/e2e/cluster_logging_es.go
View file @
c4660222
...
...
@@ -45,10 +45,10 @@ var _ = framework.KubeDescribe("Cluster level logging using Elasticsearch [Featu
framework
.
ExpectNoError
(
err
,
"Elasticsearch is not working"
)
By
(
"Running synthetic logger"
)
pod
:=
createLoggingPod
(
f
,
podName
,
10
0
,
1
*
time
.
Second
)
pod
:=
createLoggingPod
(
f
,
podName
,
10
*
60
,
10
*
time
.
Minute
)
defer
f
.
PodClient
()
.
Delete
(
podName
,
&
meta_v1
.
DeleteOptions
{})
err
=
framework
.
WaitForPod
Success
InNamespace
(
f
.
ClientSet
,
podName
,
f
.
Namespace
.
Name
)
framework
.
ExpectNoError
(
err
,
fmt
.
Sprintf
(
"Should've successfully waited for pod %s to
succeed
"
,
podName
))
err
=
framework
.
WaitForPod
NameRunning
InNamespace
(
f
.
ClientSet
,
podName
,
f
.
Namespace
.
Name
)
framework
.
ExpectNoError
(
err
,
fmt
.
Sprintf
(
"Should've successfully waited for pod %s to
be running
"
,
podName
))
By
(
"Waiting for logs to ingest"
)
config
:=
&
loggingTestConfig
{
...
...
@@ -58,7 +58,6 @@ var _ = framework.KubeDescribe("Cluster level logging using Elasticsearch [Featu
MaxAllowedLostFraction
:
0
,
MaxAllowedFluentdRestarts
:
0
,
}
err
=
waitForLogsIngestion
(
f
,
config
)
framework
.
ExpectNoError
(
err
,
"Failed to ingest logs"
)
framework
.
ExpectNoError
(
waitForSomeLogs
(
f
,
config
),
"Failed to ingest logs"
)
})
})
test/e2e/cluster_logging_gcl.go
View file @
c4660222
...
...
@@ -26,8 +26,7 @@ import (
.
"github.com/onsi/ginkgo"
)
// TODO(crassirostris): Remove Flaky once test is stable
var
_
=
framework
.
KubeDescribe
(
"Cluster level logging using GCL [Flaky]"
,
func
()
{
var
_
=
framework
.
KubeDescribe
(
"Cluster level logging using GCL"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"gcl-logging"
)
BeforeEach
(
func
()
{
...
...
@@ -44,10 +43,10 @@ var _ = framework.KubeDescribe("Cluster level logging using GCL [Flaky]", func()
framework
.
ExpectNoError
(
err
,
"GCL is not working"
)
By
(
"Running synthetic logger"
)
pod
:=
createLoggingPod
(
f
,
podName
,
10
0
,
1
*
time
.
Second
)
pod
:=
createLoggingPod
(
f
,
podName
,
10
*
60
,
10
*
time
.
Minute
)
defer
f
.
PodClient
()
.
Delete
(
podName
,
&
meta_v1
.
DeleteOptions
{})
err
=
framework
.
WaitForPod
Success
InNamespace
(
f
.
ClientSet
,
podName
,
f
.
Namespace
.
Name
)
framework
.
ExpectNoError
(
err
,
fmt
.
Sprintf
(
"Should've successfully waited for pod %s to
succeed
"
,
podName
))
err
=
framework
.
WaitForPod
NameRunning
InNamespace
(
f
.
ClientSet
,
podName
,
f
.
Namespace
.
Name
)
framework
.
ExpectNoError
(
err
,
fmt
.
Sprintf
(
"Should've successfully waited for pod %s to
be running
"
,
podName
))
By
(
"Waiting for logs to ingest"
)
config
:=
&
loggingTestConfig
{
...
...
@@ -57,7 +56,6 @@ var _ = framework.KubeDescribe("Cluster level logging using GCL [Flaky]", func()
MaxAllowedLostFraction
:
0
,
MaxAllowedFluentdRestarts
:
0
,
}
err
=
waitForLogsIngestion
(
f
,
config
)
framework
.
ExpectNoError
(
err
,
"Failed to ingest logs"
)
framework
.
ExpectNoError
(
waitForSomeLogs
(
f
,
config
),
"Failed to ingest logs"
)
})
})
test/e2e/cluster_logging_gcl_load.go
View file @
c4660222
...
...
@@ -67,7 +67,7 @@ var _ = framework.KubeDescribe("Cluster level logging using GCL [Slow] [Flaky]",
MaxAllowedLostFraction
:
loadTestMaxAllowedLostFraction
,
MaxAllowedFluentdRestarts
:
loadTestMaxAllowedFluentdRestarts
,
}
err
=
waitForLogsIngestion
(
f
,
config
)
err
=
waitFor
Full
LogsIngestion
(
f
,
config
)
if
err
!=
nil
{
framework
.
Failf
(
"Failed to ingest logs: %v"
,
err
)
}
else
{
...
...
@@ -113,7 +113,7 @@ var _ = framework.KubeDescribe("Cluster level logging using GCL [Slow] [Flaky]",
MaxAllowedLostFraction
:
loadTestMaxAllowedLostFraction
,
MaxAllowedFluentdRestarts
:
loadTestMaxAllowedFluentdRestarts
,
}
err
=
waitForLogsIngestion
(
f
,
config
)
err
=
waitFor
Full
LogsIngestion
(
f
,
config
)
if
err
!=
nil
{
framework
.
Failf
(
"Failed to ingest logs: %v"
,
err
)
}
else
{
...
...
test/e2e/cluster_logging_utils.go
View file @
c4660222
...
...
@@ -141,7 +141,41 @@ func createLogsGeneratorPod(f *framework.Framework, podName string, linesCount i
})
}
func
waitForLogsIngestion
(
f
*
framework
.
Framework
,
config
*
loggingTestConfig
)
error
{
func
waitForSomeLogs
(
f
*
framework
.
Framework
,
config
*
loggingTestConfig
)
error
{
podHasIngestedLogs
:=
make
([]
bool
,
len
(
config
.
Pods
))
podWithIngestedLogsCount
:=
0
for
start
:=
time
.
Now
();
podWithIngestedLogsCount
<
len
(
config
.
Pods
)
&&
time
.
Since
(
start
)
<
config
.
IngestionTimeout
;
time
.
Sleep
(
ingestionRetryDelay
)
{
for
podIdx
,
pod
:=
range
config
.
Pods
{
if
podHasIngestedLogs
[
podIdx
]
{
continue
}
entries
:=
config
.
LogsProvider
.
ReadEntries
(
pod
)
if
len
(
entries
)
==
0
{
framework
.
Logf
(
"No log entries from pod %s"
,
pod
.
Name
)
continue
}
for
_
,
entry
:=
range
entries
{
if
_
,
ok
:=
entry
.
getLogEntryNumber
();
ok
{
framework
.
Logf
(
"Found some log entries from pod %s"
,
pod
.
Name
)
podHasIngestedLogs
[
podIdx
]
=
true
podWithIngestedLogsCount
++
break
}
}
}
}
if
podWithIngestedLogsCount
<
len
(
config
.
Pods
)
{
return
fmt
.
Errorf
(
"some logs were ingested for %d pods out of %d"
,
podWithIngestedLogsCount
,
len
(
config
.
Pods
))
}
return
nil
}
func
waitForFullLogsIngestion
(
f
*
framework
.
Framework
,
config
*
loggingTestConfig
)
error
{
expectedLinesNumber
:=
0
for
_
,
pod
:=
range
config
.
Pods
{
expectedLinesNumber
+=
pod
.
ExpectedLinesNumber
...
...
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