-
Notifications
You must be signed in to change notification settings - Fork 125
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
Delete invalid nil timestamp event streams #704
Delete invalid nil timestamp event streams #704
Conversation
b31b299
to
ba9538d
Compare
db/migrate/20230830134742_delete_nil_timestamp_event_streams.rb
Outdated
Show resolved
Hide resolved
ba9538d
to
e5f65aa
Compare
|
||
migrate | ||
|
||
expect(event_stream_stub.pluck(:id, :timestamp).flatten).to eq([good.id, good.timestamp]) |
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 is failing on timestamp precision,
1) DeleteNilTimestampEventStreams#up removes nil timestamp events, leaving others
Failure/Error: expect(event_stream_stub.pluck(:id, :timestamp).flatten).to eq([good.id, good.timestamp])
expected: [4, 2023-08-30 17:33:20.160235809 +0000]
got: [4, 2023-08-30 17:33:20.160235000 +0000]
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.
ok, I was hoping to keep it simple. I guess I can check that's not nil.
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.
You could use .to be_within()
or .to_i
both
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.
Thanks, I went with present since that's the intention of it.
Until ManageIQ/manageiq-providers-kubernetes#501 code lands, openshift events with nil timestamps will be added to event streams. These are invalid events and really mess up our queries since we timestamp is a lookup field and expected to use an index which doesn't happen when it's nil.
e5f65aa
to
2ba5fb1
Compare
Checked commit jrafanie@2ba5fb1 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
Backported to
|
Delete invalid nil timestamp event streams (cherry picked from commit acfb86d)
Until ManageIQ/manageiq-providers-kubernetes#501 code lands, openshift events with nil timestamps will be added to event streams.
These are invalid events and really mess up our queries since we timestamp is a lookup field and expected to use an index which doesn't happen when it's nil.