Project

General

Profile

Bug #14874

"Failing to add a certificate to Pidgin" test scenario always fails on devel since Sikuli fuzzy matching was implemented

Added by intrigeri almost 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Elevated
Assignee:
-
Category:
Test suite
Target version:
Start date:
10/22/2017
Due date:
% Done:

100%

Feature Branch:
test/improvements-from-buster-sprint
Type of work:
Code
Blueprint:
Starter:
Affected tool:
Instant Messaging

Description

The last commit where this test passed is 5f6a0f243098ebcfc1523bca9779be907c996d4f. The first commit where it failed is 369374f5406be8627d55272706f8c0e29c264da4. Sadly, a great number of changes happened in the meantime, including the Stretch 9.2 release.

On the picture I see the Desktop button in the sidebar is already selected => it has a blue background that the picture we're looking for hasn't. It looks like Pidgin used to forget the last opened directory, and now it remembers it. This might be caused by AppArmor changes in Linux 4.13.

I'll investigate whether this is a regression in Tails itself, or an OK change that the test suite must adapt to. The stable branch is not affected currently, but it might be that upgrading to Linux 4.13 changes this so I'll try to look into this in time for Tails 3.3.

Debug log:

    When I start "Pidgin Internet Messenger" via GNOME Activities Overview                                     # features/step_definitions/common_steps.rb:658
01:56:21.115394062: [log] ( Ctrl )  TYPE "#ENTER." 
    And I see Pidgin's account manager window                                                                  # features/step_definitions/pidgin.rb:316
01:56:21.907412434: [log] CLICK on L(711,527)@S(0)[0,0 1024x768]
    And I close Pidgin's account manager window                                                                # features/step_definitions/pidgin.rb:320
01:56:21.909663542: calling as amnesia: cp "/usr/share/ca-certificates/mozilla/CNNIC_ROOT.crt" "/home/amnesia/.gnupg/test.crt" 
01:56:22.107038917: call returned: [0, "", ""]
01:56:22.107221110: calling as amnesia: xdotool search --name 'Buddy List' windowactivate --sync
01:56:22.292349055: call returned: [0, "", ""]
01:56:24.420342894: [log] CLICK on L(322,183)@S(0)[0,0 1024x768]
01:56:24.420655251: [log] CLICK on L(361,241)@S(0)[0,0 1024x768]
01:56:25.850028480: [log] CLICK on L(643,272)@S(0)[0,0 1024x768]
01:56:27.196250066: [log] CLICK on L(145,286)@S(0)[0,0 1024x768]
01:56:28.512404560: [log] CLICK on L(123,135)@S(0)[0,0 1024x768]
01:56:30.822822108: [log] ( Alt )  TYPE "l" 
[log]  TYPE "/home/amnesia/.gnupg/test.crt#ENTER." 
    Then I cannot add a certificate from the "/home/amnesia/.gnupg" directory to Pidgin                        # features/step_definitions/pidgin.rb:478
01:56:31.564145776: [log]  TYPE "#ESC." 
    When I close Pidgin's certificate import failure dialog                                                    # features/step_definitions/pidgin.rb:490
01:56:31.676633111: [log]  TYPE "#ESC." 
    And I close Pidgin's certificate manager                                                                   # features/step_definitions/pidgin.rb:483
01:56:32.448411324: calling as amnesia: cp "/usr/share/ca-certificates/mozilla/CNNIC_ROOT.crt" "/lib/live/mount/overlay/home/amnesia/.gnupg/test.crt" 
01:56:32.578446644: call returned: [0, "", ""]
01:56:32.578686397: calling as amnesia: xdotool search --name 'Buddy List' windowactivate --sync
01:56:32.727587193: call returned: [0, "", ""]
01:56:33.511186870: [log] CLICK on L(322,183)@S(0)[0,0 1024x768]
01:56:34.933252045: [log] CLICK on L(361,241)@S(0)[0,0 1024x768]
01:56:36.443727024: [log] CLICK on L(643,272)@S(0)[0,0 1024x768]
01:56:50.374061199: Found fuzzy candidate picture for GtkFileChooserDesktopButton.png with similarity 0.7
    Then I cannot add a certificate from the "/lib/live/mount/overlay/home/amnesia/.gnupg" directory to Pidgin # features/step_definitions/pidgin.rb:478
      FindFailed: can not find GtkFileChooserDesktopButton.png in S(0)[0,0 1024x768]
        Line 2171, in file Region.java
       (RuntimeError)
      ./features/support/helpers/sikuli_helper.rb:95:in `findfailed_hook'
      ./features/support/helpers/sikuli_helper.rb:146:in `rescue in block (2 levels) in new'
      ./features/support/helpers/sikuli_helper.rb:139:in `block (2 levels) in new'
      ./features/support/helpers/sikuli_helper.rb:168:in `wait_and_click'
      ./features/step_definitions/pidgin.rb:458:in `/^I cannot add a certificate from the "([^"]+)" directory to Pidgin$/'
      features/pidgin.feature:95:in `Then I cannot add a certificate from the "/lib/live/mount/overlay/home/amnesia/.gnupg" directory to Pidgin'
    When I close Pidgin's certificate import failure dialog                                                    # features/step_definitions/pidgin.rb:490
    And I close Pidgin's certificate manager                                                                   # features/step_definitions/pidgin.rb:483
    Then I cannot add a certificate from the "/live/overlay/home/amnesia/.gnupg" directory to Pidgin           # features/step_definitions/pidgin.rb:478

Related issues

Related to Tails - Bug #14929: 'I can view a file stored in "~/Tor Browser" but not in ~/.gnupg' scenario is broken Resolved 11/07/2017
Blocks Tails - Feature #13240: Core work 2017Q4: Test suite maintenance Resolved 06/29/2017
Blocked by Tails - Feature #14817: Test suite improvements from buster sprint 1 Resolved 10/22/2017

History

#1 Updated by intrigeri almost 2 years ago

  • Subject changed from "Failing to add a certificate to Pidgin" test scenario always fails on devel since 2017-10-09 to "Failing to add a certificate to Pidgin" test scenario always fails on devel since Sikuli fuzzy matching was implemented
  • Category set to Test suite
  • Assignee changed from intrigeri to anonym
  • Priority changed from Normal to Elevated
  • Type of work changed from Research to Code

intrigeri wrote:

The stable branch is not affected currently,

Well, it's weird: I just managed to reproduce the behavior described above ("Desktop" is already selected) manually with Tails 3.2. So I bet there's a race condition wrt. updating some state that remembers which directory was selected last.

Anyway, we have this code:

  begin
    @screen.wait_and_click('GtkFileChooserDesktopButton.png', 10)
  rescue FindFailed
    # The first time we're run, the file chooser opens in the Recent
    # view, so we have to browse a directory before we can use the
    # "Type file name" button. But on subsequent runs, the file
    # chooser is already in the Desktop directory, so we don't need to
    # do anything. Hence, this noop exception handler.
  end

… and 5f6a0f243098ebcfc1523bca9779be907c996d4f..369374f5406be8627d55272706f8c0e29c264da4 changed how we handle FindFailed. I bet that's what broke this scenario. This is a regression so >normal priority.

#2 Updated by intrigeri almost 2 years ago

  • Blocks Feature #13240: Core work 2017Q4: Test suite maintenance added

#3 Updated by intrigeri almost 2 years ago

  • Parent task set to #14817

#4 Updated by intrigeri almost 2 years ago

  • Related to Bug #14929: 'I can view a file stored in "~/Tor Browser" but not in ~/.gnupg' scenario is broken added

#5 Updated by intrigeri almost 2 years ago

  • Target version changed from Tails_3.3 to Tails_3.5

#6 Updated by intrigeri almost 2 years ago

  • Assignee changed from anonym to intrigeri
  • QA Check set to Ready for QA
  • Feature Branch set to test/improvements-from-buster-sprint

test/improvements-from-buster-sprint (based on post-3.3 stable branch) is not affected. I'll check if devel is still affected after this topic branch has been merged in there.

#7 Updated by anonym almost 2 years ago

This issue was coincidentally fixed in the feature branch by ad7b328f264b94e6c3355f699708f9de59d89c5f: before this commit we tried to re-raise original FindFailed exception, but due to some rjb bug it doesn't become a "true" one, so the rescue FindFailed part won't catch it, hence the need for the workaround here as well.

#8 Updated by intrigeri almost 2 years ago

  • Parent task deleted (#14817)

#9 Updated by intrigeri almost 2 years ago

  • Blocked by Feature #14817: Test suite improvements from buster sprint 1 added

#10 Updated by intrigeri almost 2 years ago

  • Status changed from Confirmed to In Progress
  • % Done changed from 0 to 90

Confirmed! I'll mark as resolved once the feature branch is merged.

#11 Updated by intrigeri almost 2 years ago

  • Assignee changed from intrigeri to anonym

I think anonym will be able to merge the topic branch himself once the last blocker is resolved.

#12 Updated by intrigeri almost 2 years ago

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

This was merged into stable & devel.

#13 Updated by intrigeri over 1 year ago

  • Target version changed from Tails_3.5 to Tails_3.4

#14 Updated by anonym over 1 year ago

  • Status changed from Fix committed to Resolved

Also available in: Atom PDF