Skip to content

Conversation

@zhiyuanliang-ms
Copy link
Member

@zhiyuanliang-ms zhiyuanliang-ms commented Jul 31, 2025

Why this PR?

Sometimes, the CI pipeline will report the following error:

Error message
System.InvalidOperationException : Collection was modified; enumeration operation may not execute.



Stack trace
at System.Collections.Generic.List`1.Enumerator.MoveNext()
at Tests.AzureAppConfiguration.Tests.TestActivitySource() in C:\__w\1\s\AppConfiguration-DotnetProvider\tests\Tests.AzureAppConfiguration\Unit\Tests.cs:line 377
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

The issue is that the ActivityListener callback can be invoked on different threads. The fix is to ensure that each test thread is listen to diffferent activity source.

@zhiyuanliang-ms zhiyuanliang-ms marked this pull request as ready for review July 31, 2025 02:53
@zhiyuanliang-ms zhiyuanliang-ms merged commit ae71811 into main Jul 31, 2025
3 checks passed
@zhiyuanliang-ms zhiyuanliang-ms deleted the zhiyuanliang/fix-test branch July 31, 2025 06:47
zhiyuanliang-ms added a commit that referenced this pull request Aug 21, 2025
* Merge pull request #684 from Azure/zhiyuanliang/fix-test

Fix activity source test bug

* Fix bug with endpoint failover (#686)

* update endpoint in do while

* add test

* in progress

* update test, update logic to backoff using correct endpoint

* make test more specific

---------

Co-authored-by: AMER JUSUPOVIC <ajusupovic@microsoft.com>
Co-authored-by: Amer Jusupovic <32405726+amerjusupovic@users.noreply.github.com>

* Support comment in json key value (#685)

* support jsonc

* remove unused reference

* use private static option

* Add request tracing for Aspire usage (#687)

* add request tracing for aspire component

* update tag name

* version bump 8.4.0 (#690)

---------

Co-authored-by: AMER JUSUPOVIC <ajusupovic@microsoft.com>
Co-authored-by: Amer Jusupovic <32405726+amerjusupovic@users.noreply.github.com>
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.

3 participants