From d46ce0cb215d5cce84a3301beb692133c4431c84 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Wed, 20 Mar 2019 16:43:48 +1100 Subject: [PATCH] DEV: speed up ember acceptance tests ## Before ``` Acceptance: Composer::Image resizing buttons: 7985ms Acceptance: Composer::Edit the first post: 3854ms Acceptance: Composer::Composer with dirty edit can toggle to another edit: 3707ms Acceptance: Composer::Composer can toggle between edit and reply: 3704ms Acceptance: Composer::Tests the Composer controls: 3685ms Acceptance: Composer::Composer draft with dirty reply can toggle to edit: 3670ms Acceptance: Composer::Composer can toggle layouts (open, fullscreen and draft): 3278ms Acceptance: Composer::Switching composer whisper state: 3266ms Acceptance: Composer::Create a topic with server side errors: 3253ms Acceptance: Composer::Composer with dirty reply can toggle to edit: 3189ms Acceptance: Composer::Create a Topic: 3168ms Acceptance: Composer::Create an enqueued Topic: 2767ms Acceptance: Composer::Posting on a different topic: 2394ms Acceptance: Composer::Composer can switch between edits: 2318ms Acceptance: Composer::Create an enqueued Reply: 2317ms Acceptance: Composer::Create a Reply: 2292ms Acceptance: Composer::Checks for existing draft: 1696ms Acceptance: Composer::Composer can toggle between reply and createTopic: 1415ms Acceptance: Composer::Composer can toggle whispers: 1296ms Acceptance: Composer::Loading draft also replaces the recipients: 594ms ``` ## After ``` Acceptance: Composer::Composer can toggle layouts (open, fullscreen and draft): 2305ms Acceptance: Composer::Switching composer whisper state: 2205ms Acceptance: Composer::Composer draft with dirty reply can toggle to edit: 2185ms Acceptance: Composer::Composer can toggle between edit and reply: 1719ms Acceptance: Composer::Composer with dirty edit can toggle to another edit: 1682ms Acceptance: Composer::Composer with dirty reply can toggle to edit: 1657ms Acceptance: Composer::Composer can toggle between reply and createTopic: 1412ms Acceptance: Composer::Posting on a different topic: 1341ms Acceptance: Composer::Edit the first post: 1327ms Acceptance: Composer::Create an enqueued Reply: 1306ms Acceptance: Composer::Composer can toggle whispers: 1265ms Acceptance: Composer::Composer can switch between edits: 1260ms Acceptance: Composer::Create a Reply: 1259ms Acceptance: Composer::Create a topic with server side errors: 1183ms Acceptance: Composer::Checks for existing draft: 1172ms Acceptance: Composer::Create a Topic: 1130ms Acceptance: Composer::Image resizing buttons: 921ms Acceptance: Composer::Create an enqueued Topic: 731ms Acceptance: Composer::Tests the Composer controls: 654ms Acceptance: Composer::Loading draft also replaces the recipients: 540ms ``` That is not a typo... image resizing button went from 8 seconds to 1 second --- app/assets/javascripts/discourse/models/composer.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6 index 22c356239e5..5a3d2dd1cc4 100644 --- a/app/assets/javascripts/discourse/models/composer.js.es6 +++ b/app/assets/javascripts/discourse/models/composer.js.es6 @@ -1032,7 +1032,7 @@ const Composer = RestModel.extend({ self.set("draftConflictUser", null); self._clearingStatus = null; }, - 1000 + Ember.Test ? 0 : 1000 ); } }.observes("title", "reply")