Skip to content

[release/10.0] Source code updates from dotnet/dotnet#11

Open
hila-f-qodo wants to merge 3 commits intodevin_pr_code_review_bench_100_devin2_base_release_100_source_code_updates_from_dotnet_dotnet_pr78from
devin_pr_code_review_bench_100_devin2_head_release_100_source_code_updates_from_dotnet_dotnet_pr78
Open

[release/10.0] Source code updates from dotnet/dotnet#11
hila-f-qodo wants to merge 3 commits intodevin_pr_code_review_bench_100_devin2_base_release_100_source_code_updates_from_dotnet_dotnet_pr78from
devin_pr_code_review_bench_100_devin2_head_release_100_source_code_updates_from_dotnet_dotnet_pr78

Conversation

@hila-f-qodo
Copy link
Copy Markdown

@hila-f-qodo hila-f-qodo commented Jan 26, 2026

Benchmark PR from qodo-benchmark#78


Open with Devin

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

View issues and 3 additional flags in Devin Review.

Open in Devin Review

}

[Fact]
[TestMethod]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Test uses [TestMethod] (MSTest) instead of [Fact] (xUnit) - test will not run

The test method NavigationException_InAsyncContext_DoesNotBecomeUnobservedTaskException was changed from [Fact] to [TestMethod]. This is incorrect because the test project uses xUnit (as evidenced by other tests using [Fact] and [Theory]), and [TestMethod] is an MSTest attribute.

Click to expand

Impact

  • The test will not be discovered or executed by the xUnit test runner
  • The [QuarantinedTest] attribute (which implements xUnit's ITraitAttribute at src/Testing/src/xunit/QuarantinedTestAttribute.cs:40) will have no effect since it only works with xUnit tests
  • The using Microsoft.VisualStudio.TestTools.UnitTesting; import was added but MSTest is not configured for this project

Expected

[Fact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/pull/63708/")]
public void NavigationException_InAsyncContext_DoesNotBecomeUnobservedTaskException()

Actual

[TestMethod]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/pull/63708/")]
public void NavigationException_InAsyncContext_DoesNotBecomeUnobservedTaskException()

Recommendation: Change [TestMethod] back to [Fact] and remove the using Microsoft.VisualStudio.TestTools.UnitTesting; import.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


// See that 'back' takes you to the place from before the redirection
Browser.Navigate().Back();
Browser.Navigate().Forward();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Browser.Navigate().Forward() should be Back() - test logic is inverted

In RedirectEnhancedGetToInternal, Browser.Navigate().Back() was changed to Browser.Navigate().Forward(), but the comment on line 112 still says "See that 'back' takes you to the place from before the redirection".

Click to expand

Impact

After a redirect from /redirect to /nav/scroll-to-hash, calling Forward() would attempt to go forward in browser history (which has nothing ahead), rather than going Back() to the original /redirect page. This will cause the test assertion on line 114-115 to fail.

All other similar tests use Back()

Lines 51, 80, 141, 169, 199, 228, 257, 282 all use Browser.Navigate().Back() for the same pattern of "return to the page from before the redirection".

Expected behavior

// See that 'back' takes you to the place from before the redirection
Browser.Navigate().Back();

Actual (buggy) behavior

// See that 'back' takes you to the place from before the redirection
Browser.Navigate().Forward();

Recommendation: Change Browser.Navigate().Forward() back to Browser.Navigate().Back().

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines 32 to +33
_originalH1Element = Browser.Exists(By.TagName("h1"));
Navigate($"{ServerPathBase}/redirect");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 InitializeAsync captures h1 element before navigating to redirect page

The order of operations in InitializeAsync was swapped. Now _originalH1Element is captured before navigating to the redirect page, so it references an element from the wrong page.

Click to expand

Original (correct) order

await base.InitializeAsync();
Navigate($"{ServerPathBase}/redirect");  // First navigate

_originalH1Element = Browser.Exists(By.TagName("h1"));  // Then capture element
Browser.Equal("Redirections", () => _originalH1Element.Text);

New (buggy) order

await base.InitializeAsync();

_originalH1Element = Browser.Exists(By.TagName("h1"));  // Captures from wrong page!
Navigate($"{ServerPathBase}/redirect");  // Navigates after capture
Browser.Equal("Redirections", () => _originalH1Element.Text);  // May fail or be stale

Impact

  • _originalH1Element will reference an h1 element from whatever page base.InitializeAsync() loads, not the /redirect page
  • The assertion Browser.Equal("Redirections", ...) may fail if the initial page has a different h1 text
  • In subsequent tests, _originalH1Element will be a stale reference or reference the wrong element, causing StaleElementReferenceException or incorrect test behavior

Recommendation: Restore the original order: first Navigate($"{ServerPathBase}/redirect"), then _originalH1Element = Browser.Exists(By.TagName("h1")).

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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