Skip to content

Conversation

@kdoroszko-splunk
Copy link
Contributor

This PR adds validation of HEC token. It just checks if an event can be send via given HEC token to external Splunk.
Fix was tested locally. The result for 3 workers are presented in the attached screenshot (with pytest-splunk-addon code from develop branch it breaks main worker , restarts it and wait indefinitely).
Although splunk_external fixture is defined in the session scope it runs on each worker separately.
The following question arises: is it expected behaviour, or it's something we'd like to change (for the fixture logic to be executed before pytest splits for several processes). I do not believe that we have to check if Splunk is responsive from each worker separately. That would need to be explored (such solution might not be compatible with pytest):
image

@kdoroszko-splunk kdoroszko-splunk marked this pull request as ready for review August 7, 2024 12:20
@kdoroszko-splunk kdoroszko-splunk requested a review from a team as a code owner August 7, 2024 12:20
@artemrys artemrys changed the title fix: add hec token validation2 fix: add Splunk HEC token validation for external Splunk Aug 7, 2024
@artemrys artemrys merged commit f98a32c into ci/feature-release Aug 7, 2024
@artemrys artemrys deleted the fix/add-hec-token-validation2 branch August 7, 2024 12:39
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
@srv-rr-github-token
Copy link
Contributor

🎉 This issue has been resolved in version 5.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@harshilgajera-crest
Copy link
Contributor

Although splunk_external fixture is defined in the session scope it runs on each worker separately. The following question arises: is it expected behaviour, or it's something we'd like to change (for the fixture logic to be executed before pytest splits for several processes). I do not believe that we have to check if Splunk is responsive from each worker separately. That would need to be explored (such solution might not be compatible with pytest):

Yes so every worker executes every fixture even if it is session scoped.

Since hec token is only used for ingesting data and that happens in splunk_ingest_data we can handle this in first worker node before ingesting data that way we can avoid this issue of checking for every worker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants