Skip to content

Conversation

@zetter-rpf
Copy link

@zetter-rpf zetter-rpf commented Jan 20, 2026

This test is failing in [1] because the student ids were in a different order.

Make sure the test accepts ids in any order.

[1] - https://app.circleci.com/pipelines/github/RaspberryPiFoundation/editor-api/2948/workflows/88d009c2-3b67-46a9-8dc5-cc248bfe5df0/jobs/5600?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary

Logs

  1) SchoolStudent::List without student_ids makes a profile API call
     Failure/Error: expect(ProfileApiClient).to have_received(:list_school_students).with(token:, school_id: school.id, student_ids: students.map(&:id))
     
       #<ProfileApiClient (class)> received :list_school_students with unexpected arguments
         expected: ({:school_id=>"ebdee3e8-ecf9-4927-bd44-d7d7727b2cd4", :student_ids=>["a686fc94-c7f6-437f-bcd3-c30449c3...-4129-b858-144d2312a8b0", "13d649ab-33d1-48a8-bbad-08fcfc090ab5"], :token=>"fake-user-access-token"}) (options hash)
              got: ({:school_id=>"ebdee3e8-ecf9-4927-bd44-d7d7727b2cd4", :student_ids=>["13d649ab-33d1-48a8-bbad-08fcfc09...-4129-b858-144d2312a8b0", "a686fc94-c7f6-437f-bcd3-c30449c3e241"], :token=>"fake-user-access-token"}) (keyword arguments)
       Diff:
       
       @@ -1,6 +1,6 @@
        [{:school_id=>"ebdee3e8-ecf9-4927-bd44-d7d7727b2cd4",
          :student_ids=>
       -   ["a686fc94-c7f6-437f-bcd3-c30449c3e241",
       +   ["13d649ab-33d1-48a8-bbad-08fcfc090ab5",
            "351b87b4-a3a4-4129-b858-144d2312a8b0",
       -    "13d649ab-33d1-48a8-bbad-08fcfc090ab5"],
       +    "a686fc94-c7f6-437f-bcd3-c30449c3e241"],
          :token=>"fake-user-access-token"}]
       
     # ./spec/concepts/school_student/list_spec.rb:27:in `block (3 levels) in <top (required)>'

@cla-bot cla-bot bot added the cla-signed label Jan 20, 2026
@zetter-rpf zetter-rpf marked this pull request as ready for review January 20, 2026 10:00
@zetter-rpf zetter-rpf force-pushed the fix-intermittent-ordering-test branch from 3fd0b19 to cbf1630 Compare January 20, 2026 10:02
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