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

Fix CollectionRulePipelineTests failure due to callback registration timing. #854

Conversation

jander-msft
Copy link
Member

@jander-msft jander-msft commented Sep 14, 2021

This is an effort to fix the following test failure: https://runfo.azurewebsites.net/search/tests/?q=started%3A%7E7+definition%3Adotnet-monitor-ci+name%3ACollectionRulePipeline_StartupTriggerTest

My belief that that the callback is failing to register before the pipeline finishes is causing the TCS to not be completed and thus causing the test to fail with a TaskCanceledException. The changes make sure that the callback TCS is registered before yielding back another Task that represents the invocation of the callback, thus ensuring that the callback is registered before the test continues to start the pipeline.

I will run this PR through the build several times to see if this fixes the issue before completing it:

Most of the above test failures are likely related to #399. The /processes route is not returning within the timeout established by the test, which is 15 seconds. A fix for this is provided by #864.

@jander-msft jander-msft requested a review from a team as a code owner September 14, 2021 20:19
@jander-msft
Copy link
Member Author

jander-msft commented Sep 14, 2021

/azp run dotnet-monitor-ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

4 similar comments
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jander-msft jander-msft merged commit 6800215 into dotnet:feature/triggers Sep 16, 2021
@jander-msft jander-msft deleted the dev/jander/fix-test-callback-registration branch September 16, 2021 17:16
jander-msft added a commit that referenced this pull request Sep 17, 2021
* Initial collection rule options, validation, and unit tests. (#688)

* Generate action and trigger options in schema. (#706)

Generate action and trigger options in schema.
Add display name descriptions to these options.
Add defaults for the optional properties.

* Create `Execute` collection rule action  (#710)

* Basic implementation and registration of actions and triggers (#736)

Initial interfaces for collection rule triggers.
Implement empty action and trigger implementations.
Implement startup trigger with special interface denoting it is a startup trigger.
Rename action provider and trigger provider to descriptor.
Register action and trigger implementations with descriptors.

* Execute Action - Testing (#742)

* Update trigger interfaces with callback, start, and stop notions. (#760)

Update trigger interfaces with callback, start, and stop notions.
Refactor options providers into operations implementations.

* Refactor host building into helper method (#769)

* Refactor host building into helper method.

* Triggers - Action List Executor (#768)

* Implement collection rule pipeline, event counter trigger, and tests. (#825)

Implement collection rule pipeline and event counter trigger.
Add tests for collection rule pipeline with real and test triggers and actions.

* Create CollectDump Collection Rule Action (#824)

* Fix CollectionRulePipelineTests failure due to callback registration timing. (#854)

* Collection rule service, logging, and some functional tests (#852)

* Implement collection rule service for starting rules.
Add logging throughout collection rule system.
Add some functional tests for collection rule system.

* Refactor common parameters into CollectionRuleContext.

* Add safe cancellation.

* Add collection rule completion timeouts.

* Refactor logging event IDs into separate shareable class.

* Adjust temporary directory creation and log cleanup failures.

* Remove CollectionRulePipeline.StartAsync; replace with callback.
Add safe awaiting for start tasks and run tasks.
Add more logging and adjust some log levels.

* Replace TestCommon dependency with Xunit.Assert (#874)

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: kkeirstead <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Wiktor Kopec <[email protected]>
Co-authored-by: Patrick Fenelon <[email protected]>
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