I am writing UITests and can't find the default values for the timeouts. Does anyone know how long the default timeouts are both locally and on Xamarin TestCloud?
I have tried Google, but havent had any luck.
Did I understand correctly that if I change them that I overwrite both local and cloud values?
By default, UITests waits up to 15 seconds for tests running locally, and one minute for tests running in App Center before throwing the TimeoutException. If you specify a different wait time, that will override the default, and apply to both local & App Center tests.
If you want to change the timeout.
app.WaitForElement(c=>c.Marked("success_message_label"),
"Did not see the success message.",
new TimeSpan(0,0,0,90,0));
For more details, please see this thread.
https://learn.microsoft.com/en-us/appcenter/test-cloud/frameworks/uitest/features/timeouts
Related
We recently added MongoCk to our Spring 5 app (using the Spring runner), but are having some issues during our deploys. Our final step in the deploy process is a health check where the deployment server checks a health page every 5s for 5 minutes. Once it gets the correct response the deployment is considered successful and it finishes.
The issue is that MongoCk seems to only start the migration around 30s after the application context loads, resulting in the health check passing and the migration possibly failing after the service was "successfully" launched.
Using a standalone runner might solve this, but we really like the availability of other beans during the changelogs. So is there a way to enforce the changelogs to be processed as part of loading the application context? Or where is this delay coming from, and how can we reduce it?
You don't provide much information, but you are saying that Mongock starts 30 secs after the application context is loaded. That could be happening for two reasons:
The most likely possibility is that you are using runner-type ApplicationRunner(by default). This means that Spring decides when to run it after the entire context is loaded. From what you are saying runner-type InitializingBean is a better fit for you .
Please try this:
mongock:
runner-type: InitializingBean
You have multiple instances fighting for the lock. There is nothing we can do about it, this process is optimised(Although we are improving even more). However, as said, I believe the issue is related with the runner-type
I've tested various backgrounding options (xamarin samples, xamarin blog articles, various sources) but I'd like some clarification on the pro/cons of each one, and if some are deprecated/obsolete.
My case is an app (wifi, on client premises) that should periodically poll a server for new data, or push collected data to the server as soon as it has connection (it should continue to collect data if no connection is available, but push to the server as soon as it has connection).
I want this sync to be in the background for the user, who in the meantime can continue to work.
I would like the push (if data is present) to be done each 1 or 2 minutes, so I can just create a task in the background job with an infinite while that checks every 1/2 minutes.
I made some basic samples to test:
1) using a LongRunningTaskService : Service
2) using Firebase.JobDispatcher
3) using WorkManager (but scheduled jobs can't be less than 15 minutes)
4) looking at Shiny, but currently having trouble integrating with Prism (but I guess I'll make it work)(but don't understand if it is a wrapper of what exactly?)
Which solution do you think is appropriate for my use case?
With all the 4 solutions, data should be pushed when the app is in foreground or background (right?)
In case I need to push data only when the app is in the foreground, would it be wrong to start my Task in App class?
UPDATE
Tried this in the OnInitialized() of the App.cs:
Task.Factory.StartNew(async () =>
{
while (true)
{
await BackgroundTasks.TestPushDataRepeat();
await Task.Delay(60000);
}
}
, TaskCreationOptions.LongRunning);
It works every minute when the app is in foreground (and doesn't block the UI), but unexpectedly works also when the app is backgrounded (that is a not needed plus, for my case). Not being a service, I thought it should have freezed, why is that?
I'm trying to better understand/separate how the TPL works with Xamarin on Android, and how Android backgrounding (services/workers etc) works, to see if this solution has drawbacks.
On Android, you cannot run a background task/job/worker every 30 seconds. Such behavior can have a negative impact on the battery and can only be achieved with a Foreground Service that requires a notification visible to the user.
The limit you see for WorkManager about the 15 minutes minimum interval is an OS constraint, not a library constraint. You have the same limit if you use JobScheduler. Also a Worker (or Job if you're using JobScheduler) can run only for 10 minutes.
So, you need to have a Foreground Service. You can still use WorkManager and its advanced features in this case, but you need to use WorkManager 2.3+ and "promote" your worker to a Foreground Service. WorkManager's documentation covers this use case.
This for native Android (Java/Kotlin). I don't know how the latest Xamarin binding cover this use case.
Is the silentRenewHeartBeatCheck supposed to run every 3-4 seconds? I just want to know if I configured something wrong or not. I don't even know where to look to check for something that would configure this. If it is doing what it is supposed to be doing I won't worry about it.
In just a few minutes I've got 150 of these in chrome dev tools console:
silentRenewHeartBeatCheck
silentRenewRunning: true
idToken: true
_userData.value: true
Early on in my log I also get the below error as well but no idea what is causing it except I'm assuming it has something to do with the silent renew iframe running, but maybe not:
Active resource loading counts reached to a per-frame limit while the tab is in background. Network requests will be delayed until a previous loading finishes, or the tab is foregrounded. See https://www.chromestatus.com/feature/5527160148197376 for more details
You can check the source code here: https://github.com/damienbod/angular-auth-oidc-client/blob/master/src/services/oidc.security.service.ts.
Unfortunately, it's hard-coded to run every three seconds and there is no configuration option.
As far as the silentRenewHeartBeatCheck message issue:
In your OpenIDImplicitFlowConfiguration make sure log_console_debug_active is set to false. That will stop the silentRenewHeartBeatCheck messages in your console.
Currently, my jenkinsfile is able to compile, deploy, and start the application on my CI box. But I've no window into if the app started correctly. Technically someone can add code that compiles but doesn't start; ie code was added to reference a config, but the person never updated the config file. I want to catch those types of issues that prevents the app from starting and send an email to the person.
How can I accomplish this?
Current app takes about ~3 minutes to start. When everything successfully starts, it'll output: Started Application in 166.125 seconds (JVM running for 175.714)
Practical Challenge:
I have a LR script that runs against an app being mocked and do not have a logout button (yet).
The test runs fine With stable response time for about 10 minutes, but after that the response time peaks and the server goes into 99% memory usage and transactions start to fail.
I suspect this is due to the script does not terminate the vusers after each run anf it builds up a lot of running sessions against the server wich is not terminated. But I might be wrong.
Anyays I want to programatically close each run after it has competed the business process.
I have red somewhere that web_set_sockets_option ("SHUTDOWN_MODE", "ABRUPT") could be used for this, but I want to be sure that this function actually does what I want and what does 'ABRUPT' means?
Are there better ways of closing sessions? Clicking the close browser during recording does not result in anything being captured in the script.
It's a server issue on session aging. Your server admin for your website can adjust the timeout values where no activity has taken place on a given session. By default most places have this set at 30 minutes. Trim it to what you need rather than taking the default value on the server.
Also, you may have hit a leak situation if resources are constantly accumulated on the server side but never released.
Based on your question I assume you're using the WEB/HTML protocol. I agree that the core issue is that your app's sessions should expire more elegantly and probably sooner. But, in order to get beyond this while testing you can try this. It isn't a guarantee, but it has worked sometimes for me in the past when dealing with similar situations. Try changing your Run-time Settings for the script:
Run-time Settings > Browser > Browser Emulation
Make sure you have the box checked for "Simulate a new user on each iteration". You can also try playing with the other settings here, like clearing the cache each iteration. This could cause a new connection setting with the web page for each iteration depending on the server's session settings. Again, this isn't 100%, but it has worked for me from time to time.
try this:
web_set_sockets_option("CLOSE_KEEPALIVE_CONNECTIONS", "1");