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
eeeffbb1
Commit
eeeffbb1
authored
Oct 19, 2016
by
Anirudh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed based on comments
parent
38a6f38c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
petset.go
test/e2e/petset.go
+11
-2
No files found.
test/e2e/petset.go
View file @
eeeffbb1
...
@@ -57,6 +57,10 @@ const (
...
@@ -57,6 +57,10 @@ const (
// Should the test restart petset clusters?
// Should the test restart petset clusters?
// TODO: enable when we've productionzed bringup of pets in this e2e.
// TODO: enable when we've productionzed bringup of pets in this e2e.
restartCluster
=
false
restartCluster
=
false
// Timeout for reads from databases running on pets.
readTimeout
=
60
*
time
.
Second
)
)
// Time: 25m, slow by design.
// Time: 25m, slow by design.
...
@@ -805,15 +809,20 @@ func ExpectNoError(err error) {
...
@@ -805,15 +809,20 @@ func ExpectNoError(err error) {
}
}
func
pollReadWithTimeout
(
pet
petTester
,
petNumber
int
,
key
,
expectedVal
string
)
error
{
func
pollReadWithTimeout
(
pet
petTester
,
petNumber
int
,
key
,
expectedVal
string
)
error
{
return
wait
.
PollImmediate
(
time
.
Second
,
t
imeout
,
func
()
(
bool
,
error
)
{
err
:=
wait
.
PollImmediate
(
time
.
Second
,
readT
imeout
,
func
()
(
bool
,
error
)
{
val
:=
pet
.
read
(
petNumber
,
key
)
val
:=
pet
.
read
(
petNumber
,
key
)
if
val
==
""
{
if
val
==
""
{
return
false
,
nil
return
false
,
nil
}
else
if
val
!=
expectedVal
{
}
else
if
val
!=
expectedVal
{
return
false
,
fmt
.
Errorf
(
"
E
xpected value %v, found %v"
,
expectedVal
,
val
)
return
false
,
fmt
.
Errorf
(
"
e
xpected value %v, found %v"
,
expectedVal
,
val
)
}
}
return
true
,
nil
return
true
,
nil
})
})
if
err
==
wait
.
ErrWaitTimeout
{
return
fmt
.
Errorf
(
"timed out when trying to read value for key %v from pet %d"
,
key
,
petNumber
)
}
return
err
}
}
func
isInitialized
(
pod
api
.
Pod
)
bool
{
func
isInitialized
(
pod
api
.
Pod
)
bool
{
...
...
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