Skip to content

Pex 552/on demand detection triggers #416

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pyth0n1c
Copy link
Contributor

For integration testing, instead of scheduling a savedsearch to run and waiting a predefined amount of time, use the API to call the search right away. This can be a significant improvement in terms of the amount of time spent waiting for RBA/Notable artifacts to be generated.

time_to_execute = 0

# Check if the job is finished
while not job.is_done():
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dispatch() appears to take a **kwargs argument. Instead of using the while loop, can we just pass a {'exec_mode': 'blocking'} as we do for unit testing?

job = self.service.search(query, exec_mode="blocking") # type: ignore

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just check the description of the parameter (If set to blocking, returns the sid when the job is complete.), exec_mode sounds to be a better way than while loop! Would change it and test with pipeline later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants