Example #1
0
func logNodeEvents(f *framework.Framework) {
	framework.Logf("Summary of node events during the test:")
	err := framework.ListNamespaceEvents(f.ClientSet, "")
	framework.ExpectNoError(err)
}
Example #2
0
	. "github.com/onsi/gomega"
)

// Eviction Policy is described here:
// https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/kubelet-eviction.md

var _ = framework.KubeDescribe("MemoryEviction [Slow] [Serial] [Disruptive]", func() {
	f := framework.NewDefaultFramework("eviction-test")

	// This is a dummy context to wrap the outer AfterEach, which will run after the inner AfterEach.
	// We want to list all of the node and pod events, including any that occur while waiting for
	// memory pressure reduction, even if we time out while waiting.
	Context("", func() {
		AfterEach(func() {
			glog.Infof("Summary of node events during the memory eviction test:")
			err := framework.ListNamespaceEvents(f.Client, f.Namespace.Name)
			framework.ExpectNoError(err)
			glog.Infof("Summary of pod events during the memory eviction test:")
			err = framework.ListNamespaceEvents(f.Client, "")
			framework.ExpectNoError(err)
		})

		Context("when there is memory pressure", func() {
			AfterEach(func() {
				// Wait for the memory pressure condition to disappear from the node status before continuing.
				By("waiting for the memory pressure condition on the node to disappear before ending the test.")
				Eventually(func() error {
					nodeList, err := f.Client.Nodes().List(api.ListOptions{})
					if err != nil {
						return fmt.Errorf("tried to get node list but got error: %v", err)
					}
Example #3
0
func logPodEvents(f *framework.Framework) {
	framework.Logf("Summary of pod events during the test:")
	err := framework.ListNamespaceEvents(f.ClientSet, f.Namespace.Name)
	framework.ExpectNoError(err)
}