openedx / openedx/openedx-platform

[Flaky test] `xmodule/partitions/tests/test_partitions.py::TestPartitionService::test_get_user_group_id_for_partition`

Open
#35,640 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

flaky-test
Dominant language
Python
Stars
8.2k
Forks
4.4k
Avg merge
6d 18h
Merged PRs (30d)
42

Description

This test fails intermittently and has been deleted according to the Flaky Test Process in https://github.com/openedx/edx-platform/pull/35545.

See docs on how to address flaky tests for why this should be fixed and how to go about it.

Related: https://github.com/openedx/edx-platform/issues/35641

__________ TestPartitionService.test_get_user_group_id_for_partition ___________

self = <xmodule.partitions.tests.test_partitions.TestPartitionService testMethod=test_get_user_group_id_for_partition>

    def test_get_user_group_id_for_partition(self):
        # assign the first group to be returned
        user_partition_id = self.user_partition.id
        groups = self.user_partition.groups
        self.user_partition.scheme.current_group = groups[0]
    
        # get a group assigned to the user
        group1_id = self.partition_service.get_user_group_id_for_partition(self.user, user_partition_id)
>       assert group1_id == groups[0].id
E       AssertionError: assert 1 == 0
E        +  where 0 = Group(id=0, name='Group 1').id

xmodule/partitions/tests/test_partitions.py:473: AssertionError

(Previously filed as https://2u-internal.atlassian.net/browse/CR-7071)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with xmodule/partitions/tests/test_partitions.py::TestPartitionService::test_get_user_group_id_for_partition and compare the failing and subsequent passing CI runs linked in the issue. Follow the Flaky Test Process guidance to identify why the expected group ID intermittently differs, then restore the test after addressing the cause and verify it passes consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.