Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[META] Fix random test failures #1478

Open
20 of 27 tasks
jenlampton opened this issue Jan 3, 2016 · 31 comments
Open
20 of 27 tasks

[META] Fix random test failures #1478

jenlampton opened this issue Jan 3, 2016 · 31 comments

Comments

@jenlampton
Copy link
Member

jenlampton commented Jan 3, 2016

There are several tests that fail randomly, usually only on the Travis CI infrastructure. Let's fix them, or replace them with others so that they don't do more harm than good.

Still giving us trouble:

Fixed:

@dboulet dboulet changed the title Fix random test faulires Fix random test failures Jan 4, 2016
@quicksketch
Copy link
Member

I got a couple more randoms today. I think some of these new ones might be related to Background Fetch if the server isn't running fast enough. This was on PHP 5.4 and the tests ran for 30 minutes, compared to the normally speedy 10-15 minutes.


---- Bootstrap: Boot and exit hook invocation (HookBootExitTestCase) ----


Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Fail      Other      bootstrap.test     377 HookBootExitTestCase->testHookBootE
    Page cache cleared.
Fail      Other      bootstrap.test     380 HookBootExitTestCase->testHookBootE
    hook_boot called with aggressive cache and no cached page.
Fail      Other      bootstrap.test     381 HookBootExitTestCase->testHookBootE
    hook_exit called with aggressive cache and no cached page.


---- Layout: Layout Interface Test (LayoutInterfaceTest) ----


Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Fail      Other      layout.test        608 LayoutInterfaceTest->testMainConten
    "The "Main page content" block may only be added once to this
    layout." found
Exception Notice     layout.test        614 LayoutInterfaceTest->testMainConten
    Undefined offset: 0
Exception Notice     layout.test        618 LayoutInterfaceTest->testMainConten
    Undefined offset: 0
Fail      Other      layout.test        621 LayoutInterfaceTest->testMainConten
    Found the Save layout button
Fail      Other      layout.test        621 LayoutInterfaceTest->testMainConten
    Found the requested form fields at
Fail      Other      layout.test        622 LayoutInterfaceTest->testMainConten
    Layout saved successfully after removing old content block.
Fail      Other      layout.test        632 LayoutInterfaceTest->testMainConten
    Main content shown in sidebar after moving main content block.


---- Module: Module API (ModuleUnitTest) ----


Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Fail      Other      module.test         84 ModuleUnitTest->testModuleImplement
    The module implements cache is populated after requesting a page.

@quicksketch
Copy link
Member

Details about the "User admin test case" fail:

---- User: User administration (UserAdminTestCase) ----
Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Fail      Other      user.test         1441 UserAdminTestCase->testUserAdmin() 
    User C blocked
Fail      E-mail     user.test         1450 UserAdminTestCase->testUserAdmin() 
    Activation mail sent to user C

@quicksketch
Copy link
Member

Filed a PR at backdrop/backdrop#1200 that addresses 4 of these failures. Updated the summary.

@quicksketch
Copy link
Member

I think I've got all these worked out. For image styles and module API, the added sleep() timeouts should help the slower servers successfully pass when dealing with time-sensitive issues. The user and path alias tests I rewrote to use more robust XPath checking of elements instead of guessing based on the User ID.

The Layout: Layout Interface Test (LayoutInterfaceTest) is the only one on which I'm unclear. If that test fail keeps coming up, hopefully we will have at least narrowed the scope of the random test failures.

All the fixes so far have gone into 1.2.x and 1.x, so I'm tagging this for 1.2.4.

@quicksketch quicksketch added this to the 1.2.4 milestone Jan 13, 2016
@quicksketch
Copy link
Member

Here's dump of the current fail on the Layout Interface test fail report:

---- Layout: Layout Interface Test (LayoutInterfaceTest) ----
Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Fail      Other      layout.test        608 LayoutInterfaceTest->testMainConten
    "The "Main page content" block may only be added once to this
    layout." found
Exception Notice     layout.test        614 LayoutInterfaceTest->testMainConten
    Undefined offset: 0
Exception Notice     layout.test        618 LayoutInterfaceTest->testMainConten
    Undefined offset: 0
Fail      Other      layout.test        621 LayoutInterfaceTest->testMainConten
    Found the Save layout button
Fail      Other      layout.test        621 LayoutInterfaceTest->testMainConten
    Found the requested form fields at
Fail      Other      layout.test        622 LayoutInterfaceTest->testMainConten
    Layout saved successfully after removing old content block.
Fail      Other      layout.test        632 LayoutInterfaceTest->testMainConten
    Main content shown in sidebar after moving main content block.

Looks like our old friend "Invalid JSON" is still happening as well:

---- User: User email administration (UserAdminSettingsEmailFormTest) ----
Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Exception Uncaught e config.inc         898 ConfigFileStorage->read()          
    ConfigStorageReadException: The configuration file "user.mail" is
    not properly formatted JSON. in ConfigFileStorage->read() (line 898 of
    /home/travis/build/jenlampton/backdrop/core/includes/config.inc).

@quicksketch
Copy link
Member

We're still getting a lot of failing page cache tests:

---- Bootstrap: Page cache test (BootstrapPageCacheTestCase) ----
Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------

Fail      Other      bootstrap.test     204 BootstrapPageCacheTestCase->testPag
    Cached page request.

I think this might have to do with the background fetch functionality and our use of sleep() to try and wait long enough, but that is not guaranteed, especially with the slower Travis CI servers. I filed a new PR at backdrop/backdrop#1367.

@quicksketch
Copy link
Member

I merged in backdrop/backdrop#1367, which passed the fist attempt. We'll see how it does with new PRs as they come in.

@Gormartsen
Copy link
Member

I am able to reproduce next issue with backdrop/backdrop#1367 applied.

Bootstrap: Page cache test (BootstrapPageCacheTestCase) 155 passes, 1 fail, 0 exceptions, and 41 debug messages

Test run duration: 58 sec

Detailed test results
---------------------


---- Bootstrap: Page cache test (BootstrapPageCacheTestCase) ----


Status    Group      Filename          Line Function
--------------------------------------------------------------------------------
Fail      Other      bootstrap.test     202 BootstrapPageCacheTestCase->testPag
    Initial page requests returned before shutdown functions are executed.

I am doing investigation here.

@Gormartsen
Copy link
Member

Gormartsen commented May 14, 2016

PS: random fail happen again here: https://travis-ci.org/backdrop/backdrop/jobs/130238636

---- Bootstrap: Page cache test (BootstrapPageCacheTestCase) ----
Status    Group      Filename          Line Function                            
--------------------------------------------------------------------------------
Fail      Other      bootstrap.test     328 BootstrapPageCacheTestCase->testPag
    Page was cached.

@Gormartsen
Copy link
Member

Gormartsen commented May 14, 2016

This test is failing here:

  $start = microtime(TRUE);
    $this->backdropGet('system-test/sleep/shutdown/5', array(), $headers);
    $total = microtime(TRUE) - $start;
    $this->assertEqual($this->backdropGetHeader('X-Backdrop-Cache'), 'MISS', 'Initial page request was miss.');
    echo "Total: " . $total ."\n";
    $this->assertTrue($total < 5, 'Initial page requests returned before shutdown functions are executed.');

test with display $total has next result:

Bootstrap: Page cache test (BootstrapPageCacheTestCase) 155 passes, 1 fail, 0 exceptions, and 41 debug messages
Total: 5.0353920459747

Test run duration: 58 sec

Detailed test results
---------------------


---- Bootstrap: Page cache test (BootstrapPageCacheTestCase) ----


Status    Group      Filename          Line Function
--------------------------------------------------------------------------------
Fail      Other      bootstrap.test     203 BootstrapPageCacheTestCase->testPag
    Initial page requests returned before shutdown functions are executed.

It mean that

 $this->backdropGet('system-test/sleep/shutdown/5', array(), $headers);

takes 5.03 sec to process

data from function system_test_sleep:

<div id="start">1463241968.3128</div>
  5 seconds will be slept at shutdown. 
<div id="end">1463241968.3128</div>

@quicksketch
Copy link
Member

It mean that [...] takes 5.03 sec to process

Well in this case it's a "good" failure! Because the functionality is actually broken or not working. The page isn't being returned immediately, it's getting held up by a shutdown function when it shouldn't be. We've had some issues where backdrop_page_footer() doesn't flush and close the connection properly based on differing PHP configurations (e.g. mod_php vs. FastCGI vs. PHP-FPM). So this likely needs to be fixed in backdrop_page_footer() rather than adjusting the test.

@Gormartsen
Copy link
Member

Gormartsen commented May 14, 2016

Thank you for details @quicksketch . It is different setup from travis. I am going to figure out this one.

@Gormartsen
Copy link
Member

Gormartsen commented May 15, 2016

@quicksketch I fixed this (system-test/sleep/shutdown/5) issue. PR is here: backdrop/backdrop#1378

@quicksketch
Copy link
Member

New PR for fixing the comment-new race-condition that causes what might be our most common random failure: backdrop/backdrop#2601

@herbdool
Copy link

RTBC for this PR backdrop/backdrop#2601 (comment) @quicksketch

@klonos
Copy link
Member

klonos commented Aug 26, 2019

From time to time, I see this:

"Generated 20 URL aliases." found path_pattern.test:929

@klonos
Copy link
Member

klonos commented Aug 26, 2019

...never mind; was already in the issue summary as Path: Path pattern bulk updating (PathPatternBulkUpdateTestCase)

@quicksketch
Copy link
Member

quicksketch commented Jun 19, 2020

A new PR for a failure that's been happening frequently since 1.16.0: backdrop/backdrop#3173

@indigoxela
Copy link
Member

Seems like CommentInterfaceTest is back...

@quicksketch
Copy link
Member

We've made a lot of progress recently since the switch to GitHub Actions (a lot of these had been showing up more frequently). The following now seem resolved:

The fixing of #5205 should fix intermittent failures in several other tests (anything that used batch processing). I think this may include #1965, but I'll leave that issue open to confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants