Skip to content

Users are not saved in data.json file so Locust doesn't know what exams to click on & other errors #2

Description

@lord-vinayak

The test_data_manager.py script is flawlessly creating hundreds of exams and registrations in your database, but it completely forgets to write their IDs down into data.json! Because those lists are empty [ ], when Locust boots up, it logs the users in, but it doesn't know what exams to click on. So, Locust just skips the exam entirely.

Also, after fixing the above issue, when a virtual user logs in, lets say, as student_45@loadtest.com, the test_data_manager.py opens data.json, looks at all 500 exam submissions, and picks one completely at random. However, if that submission doesn't belong to that user (which is the most probable scenario), Frappe's security immediately blocks it and gives a Validation Error. To fix this, we can make test_data_manager.py save a perfect map of exactly which user owns which exam inside data.json.

Also, in locustfile.py, in function submit_question_response at line 257, yes, we definitely need to get actual 10-character database hash for the question. Right now, because Locust sends the fake string "question_1", the database fails to find it, and Frappe throws the 417 Expectation Failed error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions