Skip to content

Commit

Permalink
nit: fix logging functional test
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
  • Loading branch information
SchSeba committed Dec 5, 2023
1 parent 1382ccf commit db8e79a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/conformance/tests/test_sriov_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,27 @@ var _ = Describe("[sriov] operator", func() {
By("Assert logs contains less operator activity")
Eventually(func(g Gomega) {
logs := getOperatorLogs(since)
g.Expect(logs).To(

// time only contains sec, but we can have race here that in the same sec there was a sync
afterLogs := []string{}
found := false
for _, log := range logs {
if found {
afterLogs = append(afterLogs, log)
}
if strings.Contains(log, "{\"new-level\": 0, \"current-level\": 2}") {
found = true
}
}

g.Expect(afterLogs).To(
ContainElement(And(
ContainSubstring("Reconciling SriovOperatorConfig"),
)),
)

// Should not contain verbose logging
g.Expect(logs).ToNot(
g.Expect(afterLogs).ToNot(
ContainElement(
ContainSubstring("Start to sync webhook objects"),
),
Expand Down

0 comments on commit db8e79a

Please sign in to comment.