Bug 517264 (browser_tests) - Refactor old Browser* tests into Test_*_Browser
Summary: Refactor old Browser* tests into Test_*_Browser
Status: VERIFIED FIXED
Alias: browser_tests
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC All
: P3 minor (vote)
Target Milestone: 4.8 M2   Edit
Assignee: Leo Ufimtsev CLA
QA Contact: Leo Ufimtsev CLA
URL: https://etherpad.openstack.org/p/Ecli...
Whiteboard:
Keywords: test
Depends on:
Blocks: 420365 452605 webkitBrowser1Crash
  Show dependency tree
 
Reported: 2017-05-25 16:52 EDT by Leo Ufimtsev CLA
Modified: 2017-09-14 11:12 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Ufimtsev CLA 2017-05-25 16:52:59 EDT
We have a very old set of Browser(1-8) tests, which were written before the days of jUnit and have some problems.

It's time to update them and merge them into test_*_Browser instead.

Problems:
- They usually combine multiple tests into a single one big, so if something doesn't work, it's not clear what's broken.
- They are unnecessarily slow. E.g even when a condition is reached, they still wait on a hard timeout and only check for condition after.
- The wait mechanism is problematic, in that the threading can cause unexpected behaviour.  e.g Bug webkitBrowser1Crash ( Bug 515471 ) The wait logic in test_*_browser is better.

I shall be submitting relevant patches.
Comment 1 Eclipse Genie CLA 2017-05-25 17:14:41 EDT
New Gerrit change created: https://git.eclipse.org/r/97997
Comment 2 Eclipse Genie CLA 2017-05-26 14:40:50 EDT
New Gerrit change created: https://git.eclipse.org/r/98075
Comment 3 Eclipse Genie CLA 2017-05-26 18:41:25 EDT
New Gerrit change created: https://git.eclipse.org/r/98088
Comment 4 Eclipse Genie CLA 2017-05-30 16:36:19 EDT
New Gerrit change created: https://git.eclipse.org/r/98260
Comment 5 Eclipse Genie CLA 2017-05-31 17:32:47 EDT
New Gerrit change created: https://git.eclipse.org/r/98389
Comment 6 Eclipse Genie CLA 2017-06-02 16:16:43 EDT
New Gerrit change created: https://git.eclipse.org/r/98572
Comment 7 Eclipse Genie CLA 2017-06-08 16:07:18 EDT
New Gerrit change created: https://git.eclipse.org/r/98955
Comment 8 Eclipse Genie CLA 2017-06-08 16:26:17 EDT
New Gerrit change created: https://git.eclipse.org/r/98960
Comment 9 Leo Ufimtsev CLA 2017-06-28 09:03:22 EDT
I want to verify that tests work well on Cocoa/Win32, then I'll merge the new jUnits.
Comment 10 Leo Ufimtsev CLA 2017-06-28 11:25:59 EDT
(In reply to Leo Ufimtsev from comment #9)
> I want to verify that tests work well on Cocoa/Win32, then I'll merge the
> new jUnits.

Eta: next week-ish.
Comment 11 Leo Ufimtsev CLA 2017-07-06 14:12:39 EDT
I'm setting up Cocoa/Win32 servers to test these patches prior to merge. Will get to this after.
Comment 14 Leo Ufimtsev CLA 2017-08-02 12:46:37 EDT
All outstanding patches fixed/updated & tested on Win10/OSX/Linux. Now waiting for master to re-open and merge.
Comment 21 Leo Ufimtsev CLA 2017-08-09 15:35:36 EDT
All old Browser_test* cases were replaced by improved Test_*_Browser tests that run faster and break large tests apart into smaller chunks.
Comment 22 Eclipse Genie CLA 2017-08-09 15:48:40 EDT
New Gerrit change created: https://git.eclipse.org/r/102812
Comment 24 Dani Megert CLA 2017-08-10 04:32:33 EDT
How can you mark a bug as VERFIFIED when you not even waited for the first official test results (http://download.eclipse.org/eclipse/downloads/drops4/I20170809-2000/testResults.php)? ;-)

Test_org_eclipse_swt_browser_Browser#test_setUrl_local so far failed on two platforms but with different errors. Let's see what the other platforms will say.
Comment 25 Leo Ufimtsev CLA 2017-08-10 10:27:55 EDT
(In reply to Dani Megert from comment #24)
> How can you mark a bug as VERFIFIED when you not even waited for the first
> official test results
> (http://download.eclipse.org/eclipse/downloads/drops4/I20170809-2000/
> testResults.php)? ;-)
> 
> Test_org_eclipse_swt_browser_Browser#test_setUrl_local so far failed on two
> platforms but with different errors. Let's see what the other platforms will
> say.

That's a good point.

Local maven tests worked on linux/cocoa/win. But I should have waited to verify it worked on servers. I'll check.
Comment 26 Eclipse Genie CLA 2017-08-10 12:02:28 EDT
New Gerrit change created: https://git.eclipse.org/r/102896
Comment 28 Leo Ufimtsev CLA 2017-08-10 12:11:22 EDT
(In reply to Eclipse Genie from comment #26)
> New Gerrit change created: https://git.eclipse.org/r/102896

Should hopefully fix the test_setUrl_local() issue. I can't reproduce it on my local linux/mac/win10 machines, but have a theory as to why they fail.

I'll check builds tomorrow for progress.
Comment 29 Leo Ufimtsev CLA 2017-08-11 15:02:06 EDT
test_setUrl_local() now passed on Cocoa. (There is a graphics/setCursor test case failing). 
On windows test_setUrl_remote() failed due to a timeout. (before fix it said "page could not be displayed". Issue could have occurred due to bad internet connection at server or slow performance.

I will check again on monday/tuesday. If test continues to fail I'll investigate further.
Comment 30 Leo Ufimtsev CLA 2017-08-14 12:35:40 EDT
The newly added "test_setUrl_remote()" test doesn't seem to be stable. 

2/3 times it worked, but yesterday it again timed out on windows. It's possible that slow internet connection is to blame.

I'll attempt to increase the timeout specifically for that case, to see if there will be an improvement.
Comment 31 Eclipse Genie CLA 2017-08-14 14:34:59 EDT
New Gerrit change created: https://git.eclipse.org/r/103069
Comment 33 Leo Ufimtsev CLA 2017-08-14 14:51:31 EDT
Let's wait for a few days and see what happens.
Comment 34 Eclipse Genie CLA 2017-08-15 12:39:41 EDT
New Gerrit change created: https://git.eclipse.org/r/103113
Comment 35 Leo Ufimtsev CLA 2017-08-15 13:08:35 EDT
(In reply to Eclipse Genie from comment #34)
> New Gerrit change created: https://git.eclipse.org/r/103113

test_setUrl_remote() still fails sporadically on timeout.
Sometimes it works, sometimes it times out. This test needs a working internet, so I presume it times out if internet is not working prorerly. 

Adding an assumption that checks internet. If internet doesn't work, skip test.
This should make this test less noisy. Note, other tests test setUrl() against local files, so setUrl is still well covered even if intent sometimes doesn't work.

Will followup in a few days.
Comment 37 Leo Ufimtsev CLA 2017-08-16 11:57:12 EDT
(In reply to Leo Ufimtsev from comment #35)
> (In reply to Eclipse Genie from comment #34)
> > New Gerrit change created: https://git.eclipse.org/r/103113
> 
> test_setUrl_remote() still fails sporadically on timeout.
> Sometimes it works, sometimes it times out. This test needs a working
> internet, so I presume it times out if internet is not working prorerly. 
> 
> Adding an assumption that checks internet. If internet doesn't work, skip
> test.
> This should make this test less noisy. Note, other tests test setUrl()
> against local files, so setUrl is still well covered even if intent
> sometimes doesn't work.
> 
> Will followup in a few days.
Comment 38 Leo Ufimtsev CLA 2017-08-16 11:57:45 EDT
(In reply to Leo Ufimtsev from comment #35)
> (In reply to Eclipse Genie from comment #34)
> > New Gerrit change created: https://git.eclipse.org/r/103113
> 
> test_setUrl_remote() 

Passed today, but test did take a very long time: 127.322 seconds.

Will keep an eye...
Comment 39 Eclipse Genie CLA 2017-08-21 15:31:03 EDT
New Gerrit change created: https://git.eclipse.org/r/103408
Comment 41 Leo Ufimtsev CLA 2017-08-21 16:16:07 EDT
setText seems to sometimes fail on windows.
"about:blank" seems to get loaded before the actual page.

Attempt to fix by skipping "about:blank" pages:
https://git.eclipse.org/r/#/c/103408/
(simmilar to how it was done in older test in the past)
Comment 42 Leo Ufimtsev CLA 2017-08-22 10:41:15 EDT
No failing tests today. Will continue to monitor.
Comment 43 Leo Ufimtsev CLA 2017-08-31 10:11:50 EDT
No failing browser test cases related to this refactoring observed so far.
-> closing.

Will followup in 1-2 weeks to verify. If someone spots something odd, please reopen/comment. Thanks.