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

Problem with parallel executive when done in both vstestconsole.exe and also visual studio by enabling parallel execution mode #1025

Open
4 tasks done
manaswinipolkampally opened this issue Nov 19, 2020 · 24 comments
Labels

Comments

@manaswinipolkampally
Copy link

manaswinipolkampally commented Nov 19, 2020

IMG_20201119_212142

Bug Report

EasyRepro Version

  • Microsoft Dynamics 365 Online Version 9.1 (9.1.x) (DB 9.1.x) online

UCI or Classic Web

  • UCI (XrmApp)

Online or On Premise

  • Online

Browser

  • Chrome

Describe the bug
My main objective is to run the tests in parallel without having the use of azure pipeline.
So studied and followed all the steps provided by the company and implement it. My machine is 32 core hence at the max almost 30 process I can run in parallel. This is working properly because of the use of Ms test adapter. I am able to launch and open browsers simultaneously but the catch over here is that the executive of the tests and it's functionality which needed to be covered is taking place with the current window not on all the browsers which are launched. Hence unable to run the tests in parallel.
We had tried multiple options such as using the concept of threads, async and await but nothing was working as expected.
Can you help us out with the issue of why this happening and why we are unable to execute tests in Parallel ?

Code to reproduce

Place this code in Properties/AssemblyInfo.cs file
[ assembly: Parallelize(Workers =3, Scope = ExecutionScope.MethodLevel]

Place the next piece of code in setting file(settings.runsettings) file which is an XML
RunConfiguration
MsTest>
Parallelize>
Workers> 3/Workers>
Scope> MethodLevel/Scope>
/Parallelize>
/MsTest>

Expected behavior
Launching the browser based on the workers count and tests that needs to be run.

Screenshots

IMG_20201119_212142
IMG_20201119_212132

@manaswinipolkampally
Copy link
Author

It's been a week and no response from team?

@Shakevg
Copy link
Contributor

Shakevg commented Nov 29, 2020

@manaswinipolkampally,
I just saw an issue with logging during parallel execution.
Could you provide information:

  1. How you create a client instance for each thread
  2. Stack trace with error

@badarmunirr
Copy link

badarmunirr commented Nov 30, 2020

@manaswinipolkampally this problem isn't with mstest it's with chrome doesn't run scripts in the background. it only executes the on-screen script

@ewingjm
Copy link
Contributor

ewingjm commented Dec 14, 2020

I don't think this is a bug with EasyRepro - we're running in parallel with it fine. The issue here is going to be in how you're instantiating XrmApp and WebClient. You'll need to share that code.

@manaswinipolkampally
Copy link
Author

I don't think this is a bug with EasyRepro - we're running in parallel with it fine. The issue here is going to be in how you're instantiating XrmApp and WebClient. You'll need to share that code.

Can you please tell me how ur executing the scripts in parallel that too in the same browser.
Can you provide me the steps that u had followed or any documentation so that I could refer and do the same to execute the tests in parallel
IMG_20201215_182742

@ewingjm
Copy link
Contributor

ewingjm commented Dec 15, 2020

You've got WebClient and XrmApp as static, meaning there will only ever be a reference to one instance. You need to create an instance of each per test method to run in parallel.

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/static

@badarmunirr
Copy link

badarmunirr commented Dec 16, 2020

I have WebClient , XrmApp both public but still not running in parallel
image
Not sure what I am doing wrong here. it's a simple case

@ewingjm
Copy link
Contributor

ewingjm commented Dec 16, 2020

Are you seeing the tests in-progress at the same time in the Test Explorer window? Or are the test methods themselves running sequentially?

@badarmunirr
Copy link

badarmunirr commented Dec 16, 2020

test methods are running parallel.
image

@ewingjm
Copy link
Contributor

ewingjm commented Dec 16, 2020

And you're only seeing one browser instance? I'm not really sure if so, instantiating an XrmApp and WebClient instance per test is what I've implemented on powerapps-specflow-bindings.

@badarmunirr
Copy link

badarmunirr commented Dec 16, 2020

I am seeing 2 browser instances, but the problem is only the on-screen browser is executing the test case and the background browser is stuck

@manaswinipolkampally
Copy link
Author

I am seeing 2 browser instances, but the problem is only the on-screen browser is executing the test case and the background browser is stuck

Yes my issue is also the same

@ewingjm
Copy link
Contributor

ewingjm commented Dec 16, 2020

I've never seen that before. Does the test that instantiated the one in the background fail? Have you tried running in headless mode?

@manaswinipolkampally
Copy link
Author

I've never seen that before. Does the test that instantiated the one in the background fail? Have you tried running in headless mode?

Yup tried but no Luck!

@badarmunirr
Copy link

@ewingjm your test cases are running parallel on chrome?

@ewingjm
Copy link
Contributor

ewingjm commented Dec 16, 2020

Yes, but I use NUnit rather than MSTest.

@badarmunirr
Copy link

Tried with Nunit still the same error

@ewingjm
Copy link
Contributor

ewingjm commented Dec 16, 2020

What's the error message?

@badarmunirr
Copy link

Not an error message. getting the same results I got with Mstest browser is getting stuck in the background

@ewingjm
Copy link
Contributor

ewingjm commented Dec 16, 2020

So does the test run itself actually succeed if it doesn't end in an error message? What happens if you put breakpoints on both test methods and try to debug through?

@badarmunirr
Copy link

I got it running using Firefox but its not working with chrome . but firefox is slow and keeps breaking

@manaswinipolkampally
Copy link
Author

Can anyone help me how to solve this issue and make my scripts run parallel in Chrome browser.

@badarmunirr
Copy link

Sure we can connect

@manaswinipolkampally
Copy link
Author

Sure we can connect
Can we have a meeting based on your availability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants