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

events: fix event endpoint tests to ignore heartbeats. #10647

Merged
merged 1 commit into from
May 24, 2021

Conversation

jrasell
Copy link
Member

@jrasell jrasell commented May 24, 2021

#10637 added initial heartbeat functionality to events and it
seems when this PR was raised, the Nomad CI provider was having
availability issues meaning the test suite was not correctly run,
thus allowing broken tests into main. The PR itself exercised test
code which had not been hit before.

The particular problem is when identifying whether the event
received is a heartbeat; this was performed using standard Golang
conditionals. Unfortunately the operator == is not defined on byte
arrays, resulting in the check always returning false. To overcome
this issue the code now uses the bytes.Equal function to correctly
compare the data.

seems when this PR was raised, the Nomad CI provider was having
availability issues meaning the test suite was not correctly run,
thus allowing broken tests into main. The PR itself exercised test
code which had not been hit before.

The particular problem is when identifying whether the event
received is a heartbeat; this was performed using standard Golang
conditionals. Unfortunately the operator == is not defined on byte
arrays, resulting in the check always returning false. To overcome
this issue the code now uses the bytes.Equal function to correctly
compare the data.
@jrasell jrasell added type/bug theme/testing Test related issues stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/events Issues related to events labels May 24, 2021
@jrasell jrasell requested a review from drewbailey May 24, 2021 08:32
@jrasell jrasell self-assigned this May 24, 2021
Copy link
Contributor

@drewbailey drewbailey left a comment

Choose a reason for hiding this comment

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

🤦 Thank you for catching & fixing!

@jrasell jrasell merged commit 51073e5 into main May 24, 2021
@jrasell jrasell deleted the b-fix-nomad-event-endpoint-tests branch May 24, 2021 12:40
notnoop pushed a commit that referenced this pull request Jun 9, 2021
…ests

events: fix event endpoint tests to ignore heartbeats.
notnoop pushed a commit that referenced this pull request Jun 9, 2021
…ests

events: fix event endpoint tests to ignore heartbeats.
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/events Issues related to events theme/testing Test related issues type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants