-
Notifications
You must be signed in to change notification settings - Fork 684
mysql test timeouts #8536
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
mysql test timeouts #8536
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -453,7 +454,7 @@ public async Task MySql_WithPersistentLifetime_ReusesContainers(bool useMultiple | |||
// it generates and mounts a config.user.inc.php file instead of using environment variables. | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On CI this would be a 12min timeout, is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-change
template):doc-idea
template):