New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TestArchiveContains/File: Check if insights operator records an event #159
Fix TestArchiveContains/File: Check if insights operator records an event #159
Conversation
a34cbf1
to
51317fe
Compare
/retest |
51317fe
to
dcf1e3c
Compare
test/integration/main_test.go
Outdated
@@ -184,12 +184,13 @@ func deleteAllPods(t *testing.T, namespace string) { | |||
} | |||
|
|||
func checkPodsLogs(t *testing.T, kubeClient *kubernetes.Clientset, message string, newLogsOnly ...bool) { | |||
timeNow := metav1.NewTime(time.Now()) | |||
timeNow.Add(-2*time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use newLogsOnly=false, it could be safer then rely on (arbitrary) time before Now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would cause problems and probably break the tests even more. If I use newLogsOnly=false, then it’s almost certain that that the check for .*Wrote \d+ records to disk in \d+
will pass immediately, as it will be in logs already.. so tests of Logs and Event will get old archive again and fail. But I agree that it’s not the best solution now, I will try to find a different one.
dcf1e3c
to
ec5452c
Compare
ec5452c
to
5a8092c
Compare
/retest |
1 similar comment
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: martinkunc, psimovec The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Checking if insights operator records an event file before checking that the records were written to the disk should prevent running tests with an older archive that doesn't have new records yet