Bug #7060

Fix automated test suite's "I run ..." step

Added by anonym 2014-04-10 14:58:58 . Updated 2014-09-02 05:17:05 .

Status:
Resolved
Priority:
High
Assignee:
Category:
Test suite
Target version:
Start date:
2014-04-10
Due date:
% Done:

100%

Feature Branch:
bugfix/7060-use-gnome-run-dialog-less
Type of work:
Code
Blueprint:

Starter:
0
Affected tool:
Deliverable for:

Description

It fails randomly by sikuli not finding GnomeRunDialog.png.

I suspect the reason is that active? in display_helper.rb isn’t reliable — it’s supposed to only return true when virt-viewer is shown. If it can return true even when that’s not the case, the click we use to focus virt-viewer (in post_vm_start_hook in common_steps.rb) may happen too early, so the focus isn’t on virt-viewer. If “I run …” step is the first interaction (which often is the case) that would result in the Alt+F2 key press being lost which explains this bug.

A more reliable way would be to use xprop -root _NET_ACTIVE_WINDOW to get the focused window, and then make sure that the returned window id is the one used by virt-viewer. Also wmctrl -i -a <window id> may be a more reliable way to focus the window than with a sikuli click.


Subtasks


Related issues

Related to Tails - Feature #5550: Test suite: run Synaptic more realistically Resolved
Blocks Tails - Feature #5288: Run the test suite automatically on autobuilt ISOs Resolved 2014-01-03 2015-10-15

History

#1 Updated by anonym 2014-04-10 22:41:39

anonym wrote:
> If “I run …” step is the first interaction (which often is the case) that would result in the Alt+F2 key press being lost which explains this bug.

I’ve now seen it happen when there has been a successful click earlier (and no snapshot restore in between) which should ensure window focus. Hence this probably isn’t the reason.

However, I can consistently make the I run ... step fail if:

  • it’s the very first step after a background snapshot restore
  • the mouse cursor is at (or close to) the position we click on in post_vm_start_hook
  • the network isn’t plugged

The point is that there are no time consuming actions needed to be done in between the snapshot restore and the first step (I run ...) so if active? is unreliable the step may run before virt-manager is there to capture the key presses.

> A more reliable way would be to use xprop -root _NET_ACTIVE_WINDOW to get the focused window, and then make sure that the returned window id is the one used by virt-viewer. Also wmctrl -i -a <window id> may be a more reliable way to focus the window than with a sikuli click.

We don’t run a window manager, and then vmctrl doesn’t work at all, and _NET_ACTIVE_WINDOW isn’t set so that particular xprop command is also not working.

#2 Updated by anonym 2014-04-10 23:09:20

anonym wrote:
> However, I can consistently make the I run ... step fail if […]

Well… I could. Suddenly the exact same setup cannot reproduce it reliably. Now I see a 1/20 failure rate. I’m out of ideas for now.

#3 Updated by intrigeri 2014-07-19 21:13:35

I’ve just been hit by this problem a few times.

#4 Updated by intrigeri 2014-08-02 16:44:06

  • blocked by Feature #5288: Run the test suite automatically on autobuilt ISOs added

#5 Updated by intrigeri 2014-08-08 21:14:33

  • blocks deleted (Feature #5288: Run the test suite automatically on autobuilt ISOs)

#6 Updated by intrigeri 2014-08-08 21:14:46

  • blocks Feature #5288: Run the test suite automatically on autobuilt ISOs added

#7 Updated by intrigeri 2014-08-08 21:17:34

  • Priority changed from Normal to High

This just makes my life too painful, raising priority. By the way, we could replace most of these occurences by running stuff from the GNOME apps menu, no? I’ve just implemented this for I2P, and it was pretty easy, and I’ve not seen it break yet.

#8 Updated by intrigeri 2014-08-12 16:32:44

  • Status changed from Confirmed to In Progress
  • Assignee changed from anonym to intrigeri

intrigeri wrote:
> This just makes my life too painful, raising priority. By the way, we could replace most of these occurences by running stuff from the GNOME apps menu, no?

Giving it a quick try. If this doesn’t work easily, I’ll reassign to anonym.

#9 Updated by intrigeri 2014-08-12 20:55:28

  • Assignee changed from intrigeri to anonym
  • Target version set to Tails_1.1.1
  • % Done changed from 0 to 50
  • QA Check set to Ready for QA
  • Feature Branch set to bugfix/7060-use-gnome-run-dialog-less

Actually, I got rid of the GNOME run dialog entirely. As a result, our test suite now does many things in more realistic ways, compared to how users do it.

#10 Updated by intrigeri 2014-08-12 21:10:15

  • related to Feature #5550: Test suite: run Synaptic more realistically added

#11 Updated by kytv 2014-08-17 23:54:44

  • Assignee changed from anonym to intrigeri
  • QA Check changed from Ready for QA to Dev Needed

The test features/firewall_leaks.feature fails in this branch due to a missing file features/images/GnomeApplicationsInternet.png, causing the ruby interpreter to crash.

  Scenario: Detecting IPv4 TCP leaks from the Unsafe Browser^[[90m                    # features/firewall_leaks.feature:18^[[0m^M
[error] GnomeApplicationsInternet.png looks like a file, but can't be found on the disk. Assume it's text.^M
^M
Error: Illegal min or max specification!^M
signal_termination_handler:Error:Signal_termination_handler called:Code 5002^M
/home/kytv/tails/features/support/helpers/sikuli_helper.rb:108: [BUG] Segmentation fault^M
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]^M
^M
-- Control frame information -----------------------------------------------^M
c:0067 p:---- s:0241 b:0241 l:000240 d:000240 CFUNC  :method_missing^M
c:0066 p:0016 s:0239 b:0238 l:000237 d:000237 METHOD /home/kytv/tails/features/support/helpers/sikuli_helper.rb:108^M
c:0065 p:0043 s:0233 b:0233 l:000708 d:000232 BLOCK  /home/kytv/tails/features/step_definitions/unsafe_browser.rb:31^M
c:0064 p:---- s:0231 b:0231 l:000230 d:000230 FINISH^M
c:0063 p:---- s:0229 b:0229 l:000228 d:000228 CFUNC  :instance_exec^M

#12 Updated by intrigeri 2014-08-18 07:29:51

  • Assignee changed from intrigeri to anonym
  • QA Check changed from Dev Needed to Ready for QA

kytv wrote:
> The test features/firewall_leaks.feature fails in this branch due to a missing file features/images/GnomeApplicationsInternet.png, causing the ruby interpreter to crash.

Fixed, thanks!

#13 Updated by anonym 2014-08-26 20:46:27

  • Status changed from In Progress to Fix committed
  • Assignee deleted (anonym)
  • % Done changed from 50 to 100
  • QA Check changed from Ready for QA to Pass

#14 Updated by anonym 2014-09-02 05:17:05

  • Status changed from Fix committed to Resolved

#15 Updated by sajolida 2014-10-14 15:32:44

  • blocks #8117 added