After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751042 - various tests speed optimizations and slower machine stabilizations
various tests speed optimizations and slower machine stabilizations
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: tests
3.16.x
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
Vladimir Benes
Depends on:
Blocks:
 
 
Reported: 2015-06-16 13:10 UTC by vladimir benes
Modified: 2016-09-20 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Increase snapshot creation timeout (1.08 KB, patch)
2015-06-16 13:19 UTC, vladimir benes
needs-work Details | Review
tests: Remove 5s delays in snapshot test (1.27 KB, patch)
2015-06-16 13:19 UTC, vladimir benes
needs-work Details | Review
tests: Remove 5s delays in snapshot test (1.26 KB, patch)
2015-06-18 14:28 UTC, vladimir benes
committed Details | Review
tests: Increase snapshot creation timeout (913 bytes, patch)
2015-06-18 14:32 UTC, vladimir benes
needs-work Details | Review
tests: Check snapshots more frequently (1.09 KB, patch)
2015-06-18 14:32 UTC, vladimir benes
accepted-commit_now Details | Review
tests: Wait for proper shutdown (1.06 KB, patch)
2015-06-18 14:33 UTC, vladimir benes
needs-work Details | Review
tests: Speed up machine creation (1.48 KB, patch)
2015-06-18 14:45 UTC, vladimir benes
needs-work Details | Review
tests: Ping checks speedup (1.49 KB, patch)
2015-06-18 14:46 UTC, vladimir benes
needs-work Details | Review
tests: Harden "Resume livecd box" test (822 bytes, patch)
2015-06-19 10:07 UTC, vladimir benes
committed Details | Review
tests: Harden "System broker machine deleted" test (957 bytes, patch)
2015-06-19 10:07 UTC, vladimir benes
committed Details | Review
tests: Increase snapshot creation timeout (946 bytes, patch)
2015-06-19 10:12 UTC, vladimir benes
committed Details | Review
tests: Check snapshots more frequently (1.09 KB, patch)
2015-06-19 10:17 UTC, vladimir benes
committed Details | Review
tests: Wait for proper shutdown (1.07 KB, patch)
2015-06-19 10:21 UTC, vladimir benes
committed Details | Review
tests: Faster booting of machine (1.49 KB, patch)
2015-06-19 10:26 UTC, vladimir benes
committed Details | Review
tests: Faster ping checks (1.32 KB, patch)
2015-06-19 10:29 UTC, vladimir benes
committed Details | Review

Description vladimir benes 2015-06-16 13:10:32 UTC
As creating snapshots is kid of slower these days (in Fedora 22) I am slightly increasing timeout of creation. This is not gnome boxes issue but more likely qemu's and of course hdd speed takes some part.

On the other hand I've removed some 5 seconds long waits. These seems to be unnecessary now.
Comment 1 vladimir benes 2015-06-16 13:19:12 UTC
Created attachment 305386 [details] [review]
tests: Increase snapshot creation timeout

Timeout for snaphot creation changes from 5 seconds to 20. Snapshot
readiness is checked every 0.25s instead of 1 second.
Comment 2 vladimir benes 2015-06-16 13:19:43 UTC
Created attachment 305387 [details] [review]
tests: Remove 5s delays in snapshot test

Remove 5 second delays from "Create snapshots and revert" test.
Comment 3 Zeeshan Ali 2015-06-17 12:35:14 UTC
Review of attachment 305386 [details] [review]:

Justification for changes in the log please.

::: tests/steps/snapshot.py
@@ +21,3 @@
     while len(context.app.findChildren(lambda x: x.roleName == 'toggle button' and x.showing \
                                                                             and x.sensitive and x.name == 'Menu')) == 0:
+        sleep(0.25)

Why are we changing this?
Comment 4 Zeeshan Ali 2015-06-17 12:35:47 UTC
Review of attachment 305387 [details] [review]:

Justification missing in the log.
Comment 5 vladimir benes 2015-06-17 12:48:37 UTC
(In reply to Zeeshan Ali (Khattak) from comment #3)
> Review of attachment 305386 [details] [review] [review]:
> 
> Justification for changes in the log please.
> 
> ::: tests/steps/snapshot.py
> @@ +21,3 @@
>      while len(context.app.findChildren(lambda x: x.roleName == 'toggle
> button' and x.showing \
>                                                                             
> and x.sensitive and x.name == 'Menu')) == 0:
> +        sleep(0.25)
> 
> Why are we changing this?

test can be quite quicker then if these snapshots are slower this can save some small amount of time
Comment 6 vladimir benes 2015-06-17 12:49:21 UTC
(In reply to Zeeshan Ali (Khattak) from comment #4)
> Review of attachment 305387 [details] [review] [review]:
> 
> Justification missing in the log.

justification? You mean something like
Remove 5 second delays from "Create snapshots and revert" test as they're just slowing the test?
Comment 7 Zeeshan Ali 2015-06-17 12:59:19 UTC
(In reply to vladimir benes from comment #5)
> (In reply to Zeeshan Ali (Khattak) from comment #3)
> > Review of attachment 305386 [details] [review] [review] [review]:
> > 
> > Justification for changes in the log please.
> > 
> > ::: tests/steps/snapshot.py
> > @@ +21,3 @@
> >      while len(context.app.findChildren(lambda x: x.roleName == 'toggle
> > button' and x.showing \
> >                                                                             
> > and x.sensitive and x.name == 'Menu')) == 0:
> > +        sleep(0.25)
> > 
> > Why are we changing this?
> 
> test can be quite quicker then if these snapshots are slower this can save
> some small amount of time

OK, since it has different rationale than main change, separate patch with its own justification (e.g Now that we wait much longer for snapshot creation, better save as much time as possible between checks for snapshot creation).
Comment 8 Zeeshan Ali 2015-06-17 13:00:59 UTC
(In reply to vladimir benes from comment #6)
> (In reply to Zeeshan Ali (Khattak) from comment #4)
> > Review of attachment 305387 [details] [review] [review] [review]:
> > 
> > Justification missing in the log.
> 
> justification? You mean something like
> Remove 5 second delays from "Create snapshots and revert" test as they're
> just slowing the test?

More like why these are not needed now but were before?
Comment 9 Zeeshan Ali 2015-06-17 13:01:44 UTC
(In reply to Zeeshan Ali (Khattak) from comment #8)
> (In reply to vladimir benes from comment #6)
> > (In reply to Zeeshan Ali (Khattak) from comment #4)
> > > Review of attachment 305387 [details] [review] [review] [review] [review]:
> > > 
> > > Justification missing in the log.
> > 
> > justification? You mean something like
> > Remove 5 second delays from "Create snapshots and revert" test as they're
> > just slowing the test?
> 
> More like why these are not needed now but were before?

"Turns out that these delays were not needed after all" would suffice too.
Comment 10 vladimir benes 2015-06-18 14:28:03 UTC
Created attachment 305589 [details] [review]
tests: Remove 5s delays in snapshot test

Turns out that these delays were not needed after all
Comment 11 vladimir benes 2015-06-18 14:32:28 UTC
Created attachment 305590 [details] [review]
tests: Increase snapshot creation timeout

Timeout for snaphot creation changes from 5 seconds to 20.
Comment 12 vladimir benes 2015-06-18 14:32:52 UTC
Created attachment 305591 [details] [review]
tests: Check snapshots more frequently

Now that we wait much longer for snapshot creation, better save as
much time as possible between checks for snapshot creation
Comment 13 vladimir benes 2015-06-18 14:33:29 UTC
Created attachment 305592 [details] [review]
tests: Wait for proper shutdown

Shutdown of Boxes takes some time in case there are more machines
running so we need to wait up to 50 seconds for it.
Comment 14 vladimir benes 2015-06-18 14:45:47 UTC
Created attachment 305597 [details] [review]
tests: Speed up machine creation

Press 3 times return with 1 second delay instead of sleeping for 3
seconds before pressing return. This may save up to two seconds
in every single machine installation.
Comment 15 vladimir benes 2015-06-18 14:46:13 UTC
Created attachment 305598 [details] [review]
tests: Ping checks speedup

Various ping options makes ping checks far quicker. Successful ping
is 1 second quicker and unsuccessful ping check is done in 1 second
instead of 10!.
Comment 16 Zeeshan Ali 2015-06-18 21:08:25 UTC
Review of attachment 305589 [details] [review]:

Good but some nitpicks:

* 'in' -> 'from'
* dot missing at the end of sentence.
Comment 17 Zeeshan Ali 2015-06-18 21:10:48 UTC
Review of attachment 305590 [details] [review]:

Seems you accidently dropped the explanation/rationale during rebase.
Comment 18 Zeeshan Ali 2015-06-18 21:11:17 UTC
Review of attachment 305591 [details] [review]:

Dot missing at end of sentence.
Comment 19 Zeeshan Ali 2015-06-18 21:14:47 UTC
Review of attachment 305592 [details] [review]:

Shortlog's incorrect. How about "tests: Wait 50s for shutdown".

::: tests/steps/general.py
@@ +129,3 @@
+        counter += 1
+        if counter == 100:
+            raise Exception("Cannot turn off Boxes in 50 seconds")

More appropriate would be: Failed to turn off..
Comment 20 Zeeshan Ali 2015-06-18 21:22:29 UTC
Review of attachment 305597 [details] [review]:

Good catch

* "Faster booting of machine" is probably more appropriate shortlog. i-e summarize change rather than benefit in shortlog.
*  "Press 3 times return" -> "Press "Return" key 3 times". Similarly "pressing return" -> "pressing "Return".
* "may" makes it sound like its a guess. I'm sure you tested it to see the benefits at work so I'd be sounding a bit more certain. :) Perhaps "may save" -> "usually saves"?
Comment 21 Zeeshan Ali 2015-06-18 21:34:31 UTC
Review of attachment 305598 [details] [review]:

* " tests: Ping checks speedup" -> "tests: Faster ping checks"
* I'm as excited about this change as you are, but you eithe want "!" or "." at the end. :)

::: tests/steps/utils.py
@@ +39,3 @@
     sleep(1)
 
+

redundant change.
Comment 22 vladimir benes 2015-06-19 10:07:23 UTC
Created attachment 305666 [details] [review]
tests: Harden "Resume livecd box" test

Add 4 seconds before pinging after resume a live cd box. This makes
test more stable on slower machines.
Comment 23 vladimir benes 2015-06-19 10:07:49 UTC
Created attachment 305667 [details] [review]
tests: Harden "System broker machine deleted" test

Wait two seconds before checking if machine still exist in Boxes
after deleting it via virsh command.
Comment 24 vladimir benes 2015-06-19 10:12:50 UTC
Created attachment 305668 [details] [review]
tests: Increase snapshot creation timeout

Timeout for snaphot creation changes from 5 seconds to 20 as it is
too low for latest Qemu.
Comment 25 vladimir benes 2015-06-19 10:17:36 UTC
Created attachment 305669 [details] [review]
tests: Check snapshots more frequently

Now that we wait much longer for snapshot creation, better save as
much time as possible between checks for snapshot creation.
Comment 26 vladimir benes 2015-06-19 10:21:55 UTC
Created attachment 305671 [details] [review]
tests: Wait for proper shutdown

Shutdown of Boxes takes some time in case there are more machines
running so we need to wait up to 50 seconds for it.
Comment 27 vladimir benes 2015-06-19 10:26:20 UTC
Created attachment 305672 [details] [review]
tests: Faster booting of machine

Press "Return" key 3 times instead of sleeping for 3 seconds before
pressing "Return" key for the first time. This usually saves up to
2 seconds in every single machine installation.
Comment 28 vladimir benes 2015-06-19 10:29:29 UTC
Created attachment 305674 [details] [review]
tests: Faster ping checks

Various ping options makes ping checks far quicker. Successful ping
is 1 second quicker and unsuccessful ping check is done in 1 second
instead of 10!
Comment 29 Zeeshan Ali 2015-06-19 13:40:31 UTC
Review of attachment 305666 [details] [review]:

* Maybe "tests: Wait longer for livecd boot" would be better summary of actual change?
* "Add 4 seconds before pinging after resume a live cd box" -> "Wait 4 seconds rather than just 2, after resuming a live CD box before pinging it".
* stable -> reliable.

I'll fix the commit log before pushing if commit log's the only thing needing improvement (in all patches)..
Comment 30 Zeeshan Ali 2015-06-19 13:42:19 UTC
Review of attachment 305667 [details] [review]:

Similar/same comments are for previous patch.
Comment 31 Zeeshan Ali 2015-06-19 14:01:18 UTC
Review of attachment 305668 [details] [review]:

ack
Comment 32 Zeeshan Ali 2015-06-19 14:02:01 UTC
Review of attachment 305669 [details] [review]:

ack
Comment 33 Zeeshan Ali 2015-06-19 14:06:00 UTC
Review of attachment 305671 [details] [review]:

The part about shortlog got ignored from last review (comment#20).
Comment 34 Zeeshan Ali 2015-06-19 14:08:58 UTC
Review of attachment 305672 [details] [review]:

ack
Comment 35 Zeeshan Ali 2015-06-19 14:10:36 UTC
Review of attachment 305674 [details] [review]:

ack
Comment 36 Zeeshan Ali 2015-06-19 14:23:55 UTC
All pushed, some with changes to commit log.