Conversation
There was a problem hiding this comment.
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
Files not reviewed (1)
- tests/Aspire.Hosting.MySql.Tests/Aspire.Hosting.MySql.Tests.csproj: Language not supported
Comments suppressed due to low confidence (2)
tests/Aspire.Hosting.MySql.Tests/MySqlFunctionalTests.cs:69
- [nitpick] Multiplying a TimeSpan directly by an integer is not supported in standard C#. If an operator overload is defined for this, consider making the conversion explicit or introducing a helper method for clarity.
var ct = new CancellationTokenSource(TestConstants.ExtraLongTimeoutTimeSpan * 2).Token;
tests/Aspire.Hosting.MySql.Tests/MySqlFunctionalTests.cs:69
- [nitpick] Consider defining a named constant (e.g., 'DoubleExtraLongTimeout') instead of multiplying the ExtraLongTimeoutTimeSpan inline. This can improve readability and consistency across tests.
var ct = new CancellationTokenSource(TestConstants.ExtraLongTimeoutTimeSpan * 2).Token;
Hmm, except that line is waiting for sql ready before starting the 2 min clock. Hmm, well, still good cleanup.. maybe I misread the logs |
| // For this reason we need to test with and without multiple instances to cover both scenarios. | ||
|
|
||
| var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); | ||
| using var cts = new CancellationTokenSource(TestConstants.ExtraLongTimeoutTimeSpan * 2); |
There was a problem hiding this comment.
On CI this would be a 12min timeout, is that intentional?
There was a problem hiding this comment.
I did this because it was 10 mins already. Now either 6 mins locally or 12 mins in CI. @sebastienros I assume you picked such a large timeout for a reason..?
There was a problem hiding this comment.
10 minutes? probably to be sure it has enough time to run on the (slow) CI since it starts multiple containers serially. I haven't checked but obviously we can pick whatever the value is from normal runs on the CI + some margin.
There was a problem hiding this comment.
OK I think this is fine as is -- maybe eventually we have some script that adjusts each test's timeouts to match CI * margin. But right now, most tests don't even have a single timeout.
There was a problem hiding this comment.
can you sign off if OK?
Description
MySql test was timing out here and it seemed almost all the 2 mins was pulling the mysql docker image.
aspire/tests/Aspire.Hosting.MySql.Tests/MySqlFunctionalTests.cs
Line 156 in 1007a6c
It's super hard to reason about whether timeouts are too long or not. They're everywhere in the tests. But it probably makes sense to convert tests to have an overall timeout like this so they're easier to reason about, and to centralize the value to some extent.
Checklist
<remarks />and<code />elements on your triple slash comments?breaking-changetemplate):doc-ideatemplate):