[FIX] survey: fix nondeterministic runbot issue
This commit fixes a nondeterministic runbot issue during the survey session
management tour suite (that actually contains multiple tours).
It turns out that the first tour is so short that it does not let enough time
to the web framework to correctly initialize everything before it gets killed
(as the tour steps are completed almost instantly).
It's hard to say exactly where the issue comes from, as the error does not
mention anything (we only know that it's a rejected promise):
"""
Error received after termination:
PromiseRejectionEvent(
isTrusted=true,
reason=Event,
type='unhandledrejection',
target=Window,
currentTarget=Window)"
"""
Removing this first tour also removes the nondeterministic issue.
It seems like an acceptable compromise as this tour was not really testing
anything anyway, we now directly start the session from the python code.
(Note: this issue only started occurring in v17).
Task-3637591
closes odoo/odoo#146107
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { accessSurveysteps } from "./survey_tour_session_tools";
|
||||
|
||||
/**
|
||||
* Small tour that will simply start the session and wait for attendees.
|
||||
*/
|
||||
registry.category("web_tour.tours").add("test_survey_session_create_tour", {
|
||||
url: "/web",
|
||||
test: true,
|
||||
steps: () => {
|
||||
return [
|
||||
...accessSurveysteps,
|
||||
{
|
||||
trigger: 'button[name="action_start_session"]',
|
||||
},
|
||||
{
|
||||
trigger: '.o_survey_session_attendees_count:contains("0")',
|
||||
run: function () {}, // check session is correctly started
|
||||
},
|
||||
];
|
||||
},
|
||||
});
|
||||
@@ -139,9 +139,6 @@ class TestUiSession(HttpCase):
|
||||
(4, timed_scored_choice_answer_3.id)],
|
||||
})
|
||||
|
||||
# =======================
|
||||
# PART 1 : CREATE SESSION
|
||||
# =======================
|
||||
def action_open_session_manager_mock(self):
|
||||
""" Mock original method to ensure we are not using another tab
|
||||
as it creates issues with automated tours. """
|
||||
@@ -152,9 +149,11 @@ class TestUiSession(HttpCase):
|
||||
'url': '/survey/session/manage/%s' % self.access_token
|
||||
}
|
||||
|
||||
with patch('odoo.addons.survey.models.survey_survey.Survey.action_open_session_manager', action_open_session_manager_mock):
|
||||
self.start_tour('/web', 'test_survey_session_create_tour', login='admin')
|
||||
# =======================
|
||||
# PART 1 : CREATE SESSION
|
||||
# =======================
|
||||
|
||||
survey_session.action_start_session()
|
||||
# tricky part: we only take into account answers created after the session_start_time
|
||||
# the create_date of the answers we just saved is set to the beginning of the test.
|
||||
# but the session_start_time is set after that.
|
||||
|
||||
Reference in New Issue
Block a user