Skip to content
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

[browser][MT] Add new test for multi-threading SignalR in Blazor WBT #98343

Merged
merged 41 commits into from
Mar 1, 2024

Conversation

ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Feb 13, 2024

Fixes #97085.
New blazor hosted test app that is runs one instance per test, we manipulate the actions using buttons that are clicked after reading a message about completing the previous action.
A minor change not connected with the original issue: mechanism for server-logs accumulation was added to AppTestBase's RunSdkStyleApp. Previously these logs were swallowed.

@ilonatommy ilonatommy added arch-wasm WebAssembly architecture area-VM-threading-mono labels Feb 13, 2024
@ilonatommy ilonatommy self-assigned this Feb 13, 2024
@ghost
Copy link

ghost commented Feb 13, 2024

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #97085.

  1. New blazor hosted test app that is runs one instance per test (not using xunit fixtures like aspnetcore does, this can be a follow-up improvement)
  2. Flow:
  • WBT communicate with the app using url query (message and transport arguments),
  • On page init, client sets up signalR connection (of transport type, transport might be longPolling or webSockets),
  • Client sends message to server that receives it and sends it back, client on receiving confirmation that server got the message sends exit request to server, app stops
  1. Client logs are available through Playwright tools, server logs are written to file that is in artifacts/bin/Wasm.Build.Tests/Release/net9.0/linux-x64/xharness-output/logs and will be available on Azure when run on CI.

Current work

  1. Assert failed: SharedArrayBuffer is not enabled on this page. Please use a modern browser and set Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy even though MT is on and right runtime is used
  2. We're missing repro and remaining tests (e.g. websockets signalR).
Author: ilonatommy
Assignees: ilonatommy
Labels:

arch-wasm, area-VM-threading-mono

Milestone: -

@pavelsavara
Copy link
Member

please drop all the CSS and visual files from the blazor template, it's just git waste

@ilonatommy ilonatommy added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Feb 20, 2024
@ilonatommy
Copy link
Member Author

Setting ContentRootPath to BlazorHosted.Client did not help with Static files may be unavailable. Reverting to default.

[] Workload updates are available. Run `dotnet workload list` for more information.
[] Executing - C:\helix\work\workitem\e\dotnet-latest\dotnet.exe run -c Debug --no-build  in pwd C:\helix\work\workitem\e\wbt artifacts\SignalRClientTests_mr3fesfn_iad\BlazorHosted.Server
	[DOTNET_ROOT] = C:\helix\work\workitem\e\dotnet-latest
	[DOTNET_INSTALL_DIR] = C:\helix\work\workitem\e\dotnet-latest
	[DOTNET_MULTILEVEL_LOOKUP] = 0
	[DOTNET_SKIP_FIRST_TIME_EXPERIENCE] = 1
	[PATH] = C:\helix\work\workitem\e\dotnet-latest;D:\a\_work\1\s\artifacts\bin\chromedriver\chromedriver_win32;C:\helix\work\correlation\dotnet-latest;C:\helix\work\correlation\xharness-cli;C:\helix\work\correlation\dotnet-cli;C:\helix\work\correlation\chrome-win;C:\helix\work\correlation\chromedriver_win32;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps;C:\Python;C:\python\scripts;C:\Program Files\nodejs\;C:\7z;C:\git\cmd;C:\Users\ContainerAdministrator\AppData\Roaming\npm;C:\Users\ContainerAdministrator\.jsvu\bin
	[EM_WORKAROUND_PYTHON_BUG_34780] = 1
	[WasmEnableWebCil] = false
[] info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[63]
[]       User profile is available. Using 'C:\Users\ContainerAdministrator\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
[] info: Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider[1]
[]       No action descriptors found. This may indicate an incorrectly configured application or missing application parts. To learn more, visit https://aka.ms/aspnet/mvc/app-parts
[] info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[58]
[]       Creating key {77b448d9-fade-4e98-9912-2e3a5d60cd64} with creation date 2024-02-27 16:38:27Z, activation date 2024-02-27 16:38:27Z, and expiration date 2024-05-27 16:38:27Z.
[] info: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[39]
[]       Writing data to file 'C:\Users\ContainerAdministrator\AppData\Local\ASP.NET\DataProtection-Keys\key-77b448d9-fade-4e98-9912-2e3a5d60cd64.xml'.
[] info: Microsoft.Hosting.Lifetime[14]
[]       Now listening on: http://localhost:5000
[] info: Microsoft.Hosting.Lifetime[0]
[]       Application started. Press Ctrl+C to shut down.
[] info: Microsoft.Hosting.Lifetime[0]
[]       Hosting environment: Production
[] info: Microsoft.Hosting.Lifetime[0]
[]       Content root path: C:\helix\work\workitem\e\wbt artifacts\SignalRClientTests_mr3fesfn_iad\BlazorHosted.Server\bin\Debug\net9.0\../../../../BlazorHosted.Client
Launching chrome ('C:\helix\work\correlation\chrome-win\chrome.exe') via playwright with args = --explicitly-allowed-ports=5000,--ignore-certificate-errors
[] info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
[]       Request starting HTTP/1.1 GET http://localhost:5000/chat?transport=LongPolling&message=ping - - -
[] info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
[]       Executing endpoint 'Fallback {*path:nonfile}'
[] info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
[]       Sending file. Request path: '/index.html'. Physical path: 'C:\helix\work\workitem\e\wbt artifacts\SignalRClientTests_mr3fesfn_iad\BlazorHosted.Client\wwwroot\index.html'
[] info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
[]       Executed endpoint 'Fallback {*path:nonfile}'
[] info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
[]       Request finished HTTP/1.1 GET http://localhost:5000/index.html?transport=LongPolling&message=ping - 200 554 text/html 42.7901ms
[] info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
[]       Request starting HTTP/1.1 GET http://localhost:5000/_framework/blazor.webassembly.js - - -
[] info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
[]       Request finished HTTP/1.1 GET http://localhost:5000/_framework/blazor.webassembly.js - 404 0 - 8.0721ms
[] info: Microsoft.AspNetCore.Hosting.Diagnostics[16]
[]       Request reached the end of the middleware pipeline without being handled by application code. Request path: GET http://localhost:5000/_framework/blazor.webassembly.js, Response status code: 404
Exception: System.TimeoutException: Timeout 30000ms exceeded.

log

@ilonatommy ilonatommy removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Feb 29, 2024
@ilonatommy ilonatommy marked this pull request as ready for review February 29, 2024 09:05
@ilonatommy ilonatommy requested a review from maraf March 1, 2024 09:00
Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you for implementing the general approach!

@ilonatommy ilonatommy merged commit 50d6e5d into dotnet:main Mar 1, 2024
22 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[browser][MT] Add new test for multi-threadin SignalR in Blazor WBT
3 participants