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.
The
test_data_manager.pyscript 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, thetest_data_manager.pyopensdata.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 maketest_data_manager.pysave a perfect map of exactly which user owns which exam insidedata.json.Also, in
locustfile.py, in functionsubmit_question_responseat 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.