angular-auth-oidc-client --> silentRenewHeartBeatCheck runs every 3-4 seconds - angular-auth-oidc-client

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.

Related

Strange API activity

Was few days away from the computers and when back to work I found this very strange activity on my ape requests graph.
I have nothing running whole weekend.
Looks like some think monitoring each 3 seconds.
Do you know what it can be or what to check?
You can go to your Admin console and from there check on the logs for your app
(under "Monitoring - > Logs"). This will tell you what was the request that caused a request to appear. Without access to your logs it's the best I can offer from here.
and 0.033 request a second is every 30 seconds, not every 3.

IIS Orphaned Requests

We have IIS 7 running a Classic ASP app and I've been noticing the following issue lately. Over the course of the day, if I look at Server Node --> Worker Processes some requests seem to fill up there. The elapsed time is something crazy like 12 hours at the end of the day. This requests all sit in the ExecuteRequestHandler stage.
There is no way anything is executing for that long, and I cannot seem to reproduce the issue. I have tried dumping w3wp.exe, using FRT, and all that good stuff, but I have some general questions:
Is there a setting that controls WHEN IIS stops a request? To be specific, in development, if I purposely design a page to be slow (i.e. update a SQL table thats locked) and then CLOSE out of browser, and monitor the requests in IIS, I see that the request still sits there for about 20 seconds before being removed. Is that 20 seconds a random interval, or can that be SET somewhere? To be clear, it's not that the page takes 20 seconds to execute, it will execute forever (in this test case) but it seems IIS gives up on it after 20 or so seconds after I log out.
Is there some way to see "orphaned" requests, I.E. requests in the app pool that nobody is waiting for anymore
What else can I do to try and debug this? A dump of w3wp says there are client connections with an HTTP request state of HTR_READING_CLIENT_REQUEST.
I keep getting suggestions of modifying IIS config settings such as AspRequestQueueMax, every time I try looking those up in the ApplicationHost.config I don't see those items set, so either I'm looking at the wrong place, or a default value would not be explicitly set in the config. This begs 2 questions: a) How do you READ these config values, i.e. get current value, b) how do you SET these.
A Classic ASP request will keep running until the script timeout is reached, regardless of whether the client is connected or not. I believe the default is 90 seconds, but an .ASP file can override this by setting the Server.ScriptTimeout property directly (which is pretty common). If your request queue is filling up then this is likely the reason and changing the defaults will not help.
If you can edit the ASP code, you can add logic like this in potentially long running sections:
If Not Response.IsClientConnected Then Call Response.End()
You can also global search your code for Server.ScriptTimeout to understand from where the abuse is coming.
If you do want to change the default script timeout, here is where it is stored:
https://www.iis.net/configreference/system.webserver/asp/limits
To change via the IIS7 GUI go to: (web site) > (features view) > ("IIS" category) > "ASP" > expand "Limits Properties" node > "Script Time-out"

close connection in LoadRunner

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");

Request Timing in `$.ajax` is sometimes above 1 second and sometimes 30ms

I am using xampp version 1.7.7 on windows 7. I am trying to do that when you click save image it would send information to save_record.php in the background. I do this with
$.ajax({
url: 'save_record.php',
data: values.join("&"),
success: function(data) {
//document.write(data);
}
});
And it is clearly not the issue. The problem is that the response is very slow and I am unable to find the reason for it. Below I add the data I received from chrome speed tracer. Firebug is also showing all responses above 1 second. They come in format like 1055ms or 1035ms which makes me think it gets stuck somewhere for one second. If that was not weird enough, it starts making the requests fast (30-50ms) at some time and that is a perfectly usable application for me. Otherwise that 1 second delay is killing it. I once killed process explorer.exe and added as a new task and it worked. But the next time it didn't. I restarted the pc - it is one second... And while I was typing this question it started doing those fast requests. Once it starts doing them fast it's all good, but when I start xampp (or open my laptop from sleep) it is usually slow (1sec+). This is a somewhat self solving problem after some time (like 5-10mins usually), but it is annoying and both curious as why this is happening :) Hopefully I was clear about the problem.
P.S. I tested and the difference in time from first php tag to last one is ~20 ms, so I assume it is not PHP cache that is acting up?
P.S.2. I would provide any other data needed, just not sure what to look at :) Just name it.
UPDATE: added Chrome's network tab.
UPDATE: after reinstallation of xampp the problem still persists:
Uncommenting the line 127.0.0.1 localhost in C:\Windows\System32\drivers\etc\hosts solved the problem. The speed just jumped up incredibly. I found this advice in here. Actually even the speed of Chrome opening other pages increased a lot o.O
Can you take a screen shot of network > Timing tab of chrome developer tool for the request which takes more than a second and share it. For eg.
You must analyze the time taken for each action mentioned in that tab. And also check the event trace from the speed tracer to get more information.
Try changing the content of save_record.php to <?php die(); ?> and see what happens. I suspect it's some kind of delay in processing the save_record operation on the server-side (could be DB is the bottleneck, could be file I/O, etc).
save_record.php ,
what code have you written if you doing any database operation may the operation is taking to much time can you provide me the code of "save_record.php" the i can able to optimize response or can able solve your query

how to perform a task after stopping the test run?

I was just trying to perform a task after i stop the test run in QTP.
The actual scenario is like this:
I want to login into some site(project internal), perform some task and when i stop the test run, it should automatically logoff from the site.
There is a logoff button too on the web page.
But the challenge is that we have to logoff after we stop the test not before stopping the test run.
kindly help me out, i tried a lot but i am not able to do that.
Thanks in advance.
I'm not sure I understand why you would want to log off after the test stops, why not have the final step of the test log off?
Also from your question it sounds like you're talking about manually stopping the test
when i stop the test run, it should automatically logoff from the site
This seems to be an un-interesting case, if you're manually stopping the test then you can manually log-off and for automatic test runs (which is the point of automatic testing) behave as is required (log off at the last step etc.)
QTP does support closing a browser after the test run (when the test is closed) this is done from the Record and Run Settings dialog.
All that being said here's a hacky way to get what (I think) you're looking for, have this as the last step of your test:
Browser("Br").Navigate "javascript:setTimeout('document.getElementById(""logout"").click();', 5000); void(0)"
What this does is tell the browser to call a specific function after 5 seconds (5000 milliseconds) (using a bookmaklet), the code being called after 5 seconds clicks on the log off button (you'll have to use the correct id or otherwise locate the button of course).
As I said I'm not sure I understood your problem so I don't know how helpful this will be.

Resources