Chapter 3: Ticket: Paging

I have a similar error to Omar Faruk where the Method and Unit Tests pass but the integration tests fail.
I get the below error.
“Paging: Did not receive the proper response when paging by genre.”
I tried adding the sort method to the return with a .Sort(sort) as hinted at in the other thread but I still have the same error.

Any help would be appreciated.

Sending you a message to share the code.

Kanika

Old post, but I spent some hours trying to figure out the cause of the error, first, I added a try-catch block to actually see the error, then I saw that my unit tests were passing maybe it was the sorting method, so I looked on the other methods and noticed that the DefaultSortOrder where being converted to a Bson document and I did it the exact same way, and it worked!

Old post, but same issue. I haven’t yet managed to found a solution. Some ideas?

Ok, i have found an answer: the errors (Chapter 3, ticket Paging) where two:

  1. Paging: Did not receive the proper response when paging by genre
  2. Paging: Did not receive the proper response when paging by text

For the first one, review the method GetMoviesByGenreAsync and fix the order of calls (find, sort, limit, skip…)

The second, is a weird thing. If you have the second one, the first is good.
The second one call another method: GetMoviesByTextAsync. Is already written and is ok.
The weird thing is the results are not always the same, and i have passed the ticket only for chance.

Further informations in private, don’t want to share solution in public.
Maybe i will open an issue.

I’m passing this test on the status screen around 20% of the time with no changes to the code. My answer matches the detailed answer but still getting unreliable results. It also seems to be manifesting on the application itself where ability to scroll is inconsistent. Can anyone explain what is going on and please point to specific lines of code and not generalities. ty

Is the order by the score (of the text search) of the documents. There are multiple documents with the same score, so the results are random. Add another field to the sort order to have stable results. But i don’t know if the test will pass.

1 Like