Skip to content
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

Merged

Conversation

psimovec
Copy link
Member

@psimovec psimovec commented Aug 11, 2020

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

@psimovec psimovec changed the title Fix TestArchiveContains/File: Check if insights operator records a log file [WIP]Fix TestArchiveContains/File: Check if insights operator records a log file Aug 11, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 11, 2020
@psimovec psimovec changed the title [WIP]Fix TestArchiveContains/File: Check if insights operator records a log file [WIP]Fix TestArchiveContains/File: Check if insights operator records an event Aug 11, 2020
@psimovec
Copy link
Member Author

/retest

@psimovec psimovec changed the title [WIP]Fix TestArchiveContains/File: Check if insights operator records an event Fix TestArchiveContains/File: Check if insights operator records an event Aug 11, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 11, 2020
@@ -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)
Copy link
Contributor

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

Copy link
Member Author

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.

@psimovec psimovec changed the title Fix TestArchiveContains/File: Check if insights operator records an event [WIP]Fix TestArchiveContains/File: Check if insights operator records an event Aug 12, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 12, 2020
@psimovec psimovec changed the title [WIP]Fix TestArchiveContains/File: Check if insights operator records an event Fix TestArchiveContains/File: Check if insights operator records an event Aug 13, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 13, 2020
@psimovec
Copy link
Member Author

/retest

1 similar comment
@psimovec
Copy link
Member Author

/retest

@martinkunc
Copy link
Contributor

/lgtm
/approved

@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 17, 2020
@openshift-merge-robot openshift-merge-robot merged commit d9a7037 into openshift:master Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants