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

Record compliance events in the compliance history API with nanoseconds #120

Conversation

mprahl
Copy link
Member

@mprahl mprahl commented Feb 27, 2024

This helps with ordering when compliance events have a timestamp that is the same down to the second.

Relates:
https://issues.redhat.com/browse/ACM-10155

@@ -198,16 +199,19 @@ var _ = Describe("Compliance API recording", Ordered, Label("compliance-events-a
g.Expect(requests[0].Event.Message).To(Equal("Halt, who goes there?"))
g.Expect(requests[0].ParentPolicy.KeyID).To(BeEquivalentTo(1))
g.Expect(requests[0].Policy.KeyID).To(BeEquivalentTo(3))
g.Expect(requests[0].Event.Timestamp.Nanosecond()).ToNot(Equal(0))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible that this could actually be 0, though it's very unlikely since it'd be a 1 in 999999999 chance for each event. If the reviewer is spooked about this flake happening, I can remove the check.

Copy link
Contributor

@yiraeChristineKim yiraeChristineKim Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean there is a possibility of the flaky test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because it's possible the the actual nanosecond of when the event was generated was 0. I'll just change it to be a unit test instead.

This helps with ordering when compliance events have a timestamp that is
the same down to the second.

Relates:
https://issues.redhat.com/browse/ACM-10155

Signed-off-by: mprahl <mprahl@users.noreply.github.com>
Copy link

openshift-ci bot commented Feb 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mprahl, yiraeChristineKim

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:
  • OWNERS [mprahl,yiraeChristineKim]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit a3c206c into open-cluster-management-io:main Feb 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants