Skip to content

Commit

Permalink
Increate timeout in VM start and stop tests
Browse files Browse the repository at this point in the history
This is an experiment, to see if the transient timout error for test

  [Fail] Vmlifecycle New VM given in a non-default namespace Should log
           libvirt start and stop lifecycle events of the domain
     [It] kubevirt-test-default

goes away when we increase the timeouts

Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr committed Aug 2, 2017
1 parent 7214f14 commit 8faf3ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions pkg/virt-handler/virtwrap/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,15 @@ func (l *LibvirtConnection) checkConnectionLost() {
return
}

// TODO, find out all errors which indicate a communication error
if err.Code != libvirt.ERR_NO_DOMAIN {
switch err.Code {
case
libvirt.ERR_INTERNAL_ERROR,
libvirt.ERR_INVALID_CONN,
libvirt.ERR_AUTH_CANCELLED,
libvirt.ERR_NO_MEMORY,
libvirt.ERR_AUTH_FAILED,
libvirt.ERR_SYSTEM_ERROR,
libvirt.ERR_RPC:
l.alive = false
logging.DefaultLogger().Error().Reason(err).With("code", err.Code).Msg("Connection to libvirt lost.")
}
Expand Down
6 changes: 3 additions & 3 deletions tests/vmlifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ var _ = Describe("Vmlifecycle", func() {

handlerName := pods.Items[0].GetObjectMeta().GetName()
handlerNamespace := pods.Items[0].GetObjectMeta().GetNamespace()
seconds := int64(30)
seconds := int64(120)
logsQuery := coreCli.Pods(handlerNamespace).GetLogs(handlerName, &k8sv1.PodLogOptions{SinceSeconds: &seconds})

// Make sure we schedule the VM to master
Expand All @@ -222,7 +222,7 @@ var _ = Describe("Vmlifecycle", func() {
data, err := logsQuery.DoRaw()
Expect(err).ToNot(HaveOccurred())
return string(data)
}, 5, 0.1).Should(MatchRegexp("(name=%s)[^\n]+(kind=Domain)[^\n]+(Domain is in state Running)", vm.GetObjectMeta().GetName()))
}, 30, 0.5).Should(MatchRegexp("(name=%s)[^\n]+(kind=Domain)[^\n]+(Domain is in state Running)", vm.GetObjectMeta().GetName()))
// Check the VM Namespace
Expect(vm.GetObjectMeta().GetNamespace()).To(Equal(namespace))

Expand All @@ -236,7 +236,7 @@ var _ = Describe("Vmlifecycle", func() {
data, err := logsQuery.DoRaw()
Expect(err).ToNot(HaveOccurred())
return string(data)
}, 5, 0.1).Should(MatchRegexp("(name=%s)[^\n]+(kind=Domain)[^\n]+(Domain deleted)", vm.GetObjectMeta().GetName()))
}, 30, 0.5).Should(MatchRegexp("(name=%s)[^\n]+(kind=Domain)[^\n]+(Domain deleted)", vm.GetObjectMeta().GetName()))

},
table.Entry(tests.NamespaceTestDefault, tests.NamespaceTestDefault),
Expand Down

0 comments on commit 8faf3ab

Please sign in to comment.