Skip to content

Conversation

@mbertrand
Copy link
Member

What are the relevant tickets?

N/A

Description (What does it do?)

Fixes a flaky test temporarily (long term fix: get rid of n+1 queries for this view)

How can this be tested?

Tests should all pass

@mbertrand mbertrand added the Needs Review An open Pull Request that is ready for review label Oct 23, 2025
Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This improves the situation, so 👍

I did notice two things:

First, lots of

  /src/learning_resources/views_test.py:1245: PytestUnknownMarkWarning: Unknown pytest.mark.skip_nplusone_check - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.skip_nplusone_check

Second: test_similar_resources_endpoint_does_not_return_self is similarly flakey. Not sure if it's the same issue, though.

@mbertrand
Copy link
Member Author

@ChristopherChudzicki
Copy link
Contributor

ChristopherChudzicki commented Oct 24, 2025

@mbertrand I merged

which fixes that failing JS test.

It looks like in mitxonline the skip_nplusone_check is registered in pytest.ini but not in Learn. Maybe we should add it to reduce the warnings?

@mbertrand
Copy link
Member Author

It looks like in mitxonline the skip_nplusone_check is registered in pytest.ini but not in Learn. Maybe we should add it to reduce the warnings?

Added

@mbertrand mbertrand merged commit ade355f into main Oct 24, 2025
13 checks passed
@mbertrand mbertrand deleted the mb/fix_n_1_test branch October 24, 2025 13:32
This was referenced Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants