-
Notifications
You must be signed in to change notification settings - Fork 12
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
Issue in SERV_SSE_CLOSE_CONNECTION_IF_EVENT_DEST_DELETED #63
Comments
Entirely possible something might be wrong here; it's not very obvious to me... Will look at it further. I know the reason it doesn't wait for a flat 5 seconds is it's trying to shave off a bit of time to move on with other testing. |
@mraineri Do we have any further updates on this? Is it OK to replace the sleep(1) with sleep(5) without having the loop? |
No updates yet; I haven't had a chance to debug this further. I would like to try to maintain the interval method of querying the service; I can see someone asking later that they have a service that takes longer to delete the event destination, and bumping up that sleep value can negatively impact test time for others. |
I need to find a system with SSE capabilities to confirm, but it looks like this is as intended; it seems like while in the for loop, "sse_response" will be updated behind the scenes when the connection is closed. |
Sorry this took so long, but here's what I'm observing from the block of code in test_sse_close_connection_if_event_dest_deleted
The statement However, if the previous DELETE operation on the subscription does not ultimately close the stream, that statement will sit until it times out reading data, or consumes some data and on the next loop throws a "StreamConsumedError" exception. This doesn't really seem like a great way to see if the connection is still alive, but so far I don't see anything in the requests module that makes this easy to check either. |
@mraineri Thanks for the response!!. Also we faced some other issue with the script. One is regarding the content type header for Post requests. Also in utils.py class SSEClientTimeout(sseclient.SSEClient): whether |
With the way this loop works today, this seems to be the case. I would really like to try to find alternatives to this check that do not rely on reading out stream data.
I'll need to do a bit of research on this; my impression is a whitespace after the semicolon is optional. Please file a separate issue on this, and I'll dig into the HTTP RFCs to see if it really is optional or not.
I see that too. It looks like that's just how the requests module is designed; read is blocking until data is ready. That's part of the challenge I'm seeing for solving this. I wouldn't mind calling into a read function to get all data if available, but having it sit until a timeout is causing other problems. In some cases it terminates the connection when the timeout is reached, which defeats the purpose of this test. |
I do see this called out in RFC7231 under "Media Type":
OWS is defined as an optional white space. Later in the same section, they state this as an example:
|
I am a newcomer to the BMC industry。 I had the same problem recently. This error occurs when the stream does not close in time after deleting an event subscription. But I don't know why. |
@mraineri Do we have any update about this issue? This issue block our tesing. Thanks, |
No updates unfortunately. I would recommend ignoring the failure in the report for the time being; if this is not possible, we can disable the test for the time being. |
In test_sse_close_connection_if_event_dest_deleted link to code , we are deleting the event destination URI and checking the SSE stream to confirm whether the stream got closed or not.
The comment says # give the service up to 5 seconds to close the stream link to code but in the logic it will just wait for one second before reading from the sse_stream and break the loop directly and throw the error without waiting for remaining 4 seconds link to code.
Whether this logic is correct ? or we can give a delay of 5 seconds directly before looping the stream link to code
The text was updated successfully, but these errors were encountered: