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

Fix sporadic error in view log REST integration test #24360

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

avpinchuk
Copy link
Contributor

This is a bug fix.

Under some circumstances the test may sporadically fails. This occurs when we expect an empty log, but it actually may contains several log records. I'm assuming this is due to the deferred write.

Signed-off-by: Alexander Pinčuk <alexander.v.pinchuk@gmail.com>
@dmatej
Copy link
Contributor

dmatej commented Mar 27, 2023

Nope, this is not how we should resolve it. Finally we would not test anything.
Also those lengths don't have anything in common, the second call should return "what was not sent in the previous query yet" if I understand it well. So then the response can be empty or not; but we have the control over the server, so we know that there should not be any log in between.

Except - there can be some log going through buffers while we do the first call. We receive the response, then the record can be processed, then in the second call we can receive it.

Probably what this test should do is:

  1. Check that the second request ends with 200 too.
  2. If the second response is not empty, check that the first record in the second response is not contained in the first response too.

@dmatej
Copy link
Contributor

dmatej commented Mar 27, 2023

Also - if the test fails, it should print why. Now it would compare numbers, it would not tell anything useful.

@avpinchuk
Copy link
Contributor Author

Because query param of request formally is an offset from the beggining of the log file, we have two cases:

  • when second get returns the emty string then an offset remains same as in previous query,
  • when is not empty then offset also greater.

Maybe try to use this conditions?

@avpinchuk
Copy link
Contributor Author

Also, when second response is empty then url's are equals. And non-equals in opposite case

@avpinchuk
Copy link
Contributor Author

I'll reopen the PR. Which option is preferred - parse offsets or just compare url's?

@dmatej
Copy link
Contributor

dmatej commented Mar 27, 2023

I'll reopen the PR. Which option is preferred - parse offsets or just compare url's?

Here I would check that the API works and accept what is correct result. So there are two possibilities - as you wrote:

  • If the URL is same, then there should be no data.
  • If the URL is different, there should be a record (first line) not present in previous response.

These two situation I would both accept as correct. Do you agree?

@avpinchuk avpinchuk marked this pull request as draft March 27, 2023 19:58
Signed-off-by: Alexander Pinčuk <alexander.v.pinchuk@gmail.com>
@avpinchuk avpinchuk marked this pull request as ready for review March 27, 2023 21:49
@dmatej dmatej added this to the 7.0.3 milestone Mar 27, 2023
@dmatej dmatej merged commit fccf533 into eclipse-ee4j:master Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants