Alert rule in Azure not triggering? - azure-monitor

I have created an alert rule according to the following:
https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-create-new-alert-rule?tabs=metric
My alert rule condition is Http5xx > 1.
I can make endpoint calls with Postman and Powershell and I get a Internal Server error 500 so I know there is an issue. I dont want to fix at the moment because I want to test that the alert is working.
The issue is thatthe alert is never triggered. When is the alert triggered and how does the alert rule check for the error conditions ?
Does it run certain queries periodically ?

Related

How to grab text that is present in alerts using robot framework

I am unable to fetch text that is present in alerts using robot framework. Could someone please help here.
handle alert accept ---> for accepting the alert
handle alert dismiss ---> for rejecting/dismissing the alert
Typically the documentation is really worth to read. Lets start with
https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Handle%20Alert.
Actions are defined to be "DISMISS", "ACCEPT" and "LEAVE". Then, there are examples:
Examples:
Handle Alert # Accept alert.
Handle Alert action=DISMISS # Dismiss alert.
Handle Alert timeout=10 s # Use custom timeout and accept alert.
Handle Alert DISMISS 1 min # Use custom timeout and dismiss alert.
${message} = Handle Alert # Accept alert and get its message.
${message} = Handle Alert LEAVE # Leave alert open and get its message.
Last example in the official documentation.

can't save changes when deleting Routing App Coverage File

I'm trying to remove the Routing App Coverage .geojson file. Every-time I try to remove this and save changes, I get this error:
We’re temporarily unable to save your changes. Please try again
later.
It's been 2 days now. I still can't remove it. If I try to change any other field in the app submission form, it works. Just not the Routing file.
Here is what happened that led to this point:
I tried to submit an app with a valid .geojson file
I got an Invalid Binary error and the app was not submitted. This is because my app does not support routing.
I try to remove the Routing .geojson file from my submission form.
It doesn't work. I keep getting the error " We’re temporarily unable to save your changes. Please try again later. "
Error keeps occurring after 2 days.
I have no idea what is wrong. Please help. Thanks
I do not know if you have solved this, but I had the same problem. Just inspect the element (that pop-up that appears on top of the Routing App coverage), delete the element from browser's tree and press the delete button.

Selenium - watch for an error condition AND run 'happy path' test code

My app displays an error dialog whenever a JavaScript error occurs. This is always a bad sign, so I want to set up my tests so that, if the error dialog appears, it causes the test to fail there and then.
So I'd like to do something like (very much pseudocode!);
// start a new 'guard' thread;
start {
found = this.driver.wait(untilVisible(By.css('.myErrorDialog')), VERY_LONG_TIMEOUT);
if (found) {
// the error dialog appeared! That's bad!
throw();
}
}
// now run the test
login();
clickButton();
testBannerContains();
But I'm having trouble and I think it has to do with the way Selenium schedules actions.
What I've found is that for a single driver, I can only schedule one thing at a time, so the guard I set up early in the test blocks the body of the test from starting.
Is there a better way to handle conditions like 'this should never happen', or a way to create two independent threads in the same test?
So the problem with the code you have is that it immediately runs it and waits for a VERY_LONG_TIMEOUT amount of time for that error dialog to appear. Since it never does, it continues to wait. You have already discovered that is not what you want... ;)
I haven't done anything like this but I think you want a JS event handler that watches for the event that is triggered when the error dialog appears. See the link below for some guidance there.
Can my WebDriver script catch a event from the webpage?
One option would be to watch for that event to fire and then store true (or whatever) in some JS variable. Before leaving a page, check to see if the variable is set to true and if so, fail the test. You can set and get JS variables using JavascriptExecutor. Some google searches should get you all you need to use it.

Confirm purchase order from automated action in Odoo

I created an automated action in Odoo that is triggered when a purchase order is updated from state = draft to state = sent. This automated action simply calls a server action that runs the following code:
record.button_confirm()
The idea is I am trying to confirm the purchase order automatically after the RFQ is sent to the vendor.
After sending the RFQ the PO is confirmed as expected. However, the vendor on the PO also receives a notification from the system related to the picking that was created. It will say something like:
"This transfer has been created from: PO00007"
If I disable my automated action and instead confirm the PO manually by clicking the "Confirm Order" button on the PO form, the order is approved, a picking is created, and this notification is not sent.
I would like my automatic approval to mimic the manual approval. Meaning, I do not want this notification to be sent.
After searching the source code, I was able to accomplish what I wanted by passing in a context key like this in the server action:
record.with_context(message_create_from_mail_mail=True).button_confirm()
I came across this solution here in the source code:
https://github.com/odoo/odoo/blob/df60828488a702acb64757f518b4be12b7a95a04/addons/mail/models/mail_message.py#L729
However, I don't understand why this is necessary or if it's even the correct way to solve this problem. I honestly don't even know what it means. I just know it works. I don't see the manual "button_confirm" method passing in this context key anywhere.
Can anyone offer any guidance here as to why this notification email is sent when I simply run button_confirm() from a server action rather than triggering it manually with a button from the UI? Also, is my solution correct or does it have some sort of side effect I am not aware of?

wxWidgets and logging

I cannot redirect log messages when building GUI applications in wxWidgets. I've tried the following snippet
delete wxLog::SetActiveTarget(new wxLogStderr()) ;
so that every call to wxLogXXX would cause a message to be print in the standard error output, not as a message dialog presented to the user. However, it had no effect, and logs continue to be present as dialog messages.
Am I missing something?
Regards.
Try removing the delete. Simply call SetActiveTarget
wxLog::SetActiveTarget(new wxLogStderr()) ;
Here's what it looks like in my IDE ( VS2008 )