Repository navigation
test: raise the thread pool minimum for the concurrency tests - #1379
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1379 +/- ##
========================================
Coverage 80.78% 80.78%
========================================
Files 306 306
Lines 13102 13102
Branches 1563 1563
========================================
Hits 10585 10585
Misses 2076 2076
Partials 441 441 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issue number: closes #1377
Summary
Changes
AWS.Lambda.Powertools.ConcurrencyTestsnow raises the thread-pool minimum to 64 worker threads in a module initializer, before any test runs.The assembly runs its test classes in parallel and has about 225 blocking calls (
Barrier.SignalAndWait,Wait(),Thread.Sleep). On small GitHub runners, the thread pool only adds threads slowly, so shortTask.Runwork can wait for seconds. That's whyMetricsAsyncContextTests.FlushDuringBackgroundWork_ShouldNotThrowExceptionfailed with "Background tasks did not start in time". Its tasks only increment a counter before any Metrics code runs.A small
ThreadPoolSetupTestsguard checks that the initializer ran.User experience
No library change, test infrastructure only. The concurrency suite runs about twice as fast locally (about 30 s instead of 55 s per framework), because the test classes now really run at the same time.
Testing
ThreadPoolSetupTestsfails without the initializer (Expected at least 64 minimum worker threads, got 14) and passes with it.DOTNET_PROCESSOR_COUNT=2: 3 runs ondevelopall passed. So this rests on the diagnosis in Flaky test: MetricsAsyncContextTests.FlushDuringBackgroundWork fails when the CI thread pool is starved #1377, not on a local before/after.KeyIsolationTestsnow hits the trace ID race from Bug: Logger throws NullReferenceException when the X-Ray trace ID changes while a log entry is built #1376 locally (NullReferenceExceptionatPowertoolsLogger.cs:238). That's the real Logging bug, not a new one, and fix(logging): read the trace ID once per log entry and handle a missing trace ID in the log buffer #1378 fixes it. With fix(logging): read the trace ID once per log entry and handle a missing trace ID in the log buffer #1378 applied on top of this branch,dotnet test tests/AWS.Lambda.Powertools.ConcurrencyTestspassed 527/527 on net8.0 and net10.0 in 3 consecutive runs. Merge fix(logging): read the trace ID once per log entry and handle a missing trace ID in the log buffer #1378 first; until then this PR's CI may fail onKeyIsolationTests.Merge danger: two-way door. Blast radius: the
AWS.Lambda.Powertools.ConcurrencyTeststest project only.Checklist
Please leave checklist items unchecked if they do not apply to your change.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.