Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8849227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:35:45+00:00 2026-06-14T12:35:45+00:00

We have some tests that fail periodically for no reason, mainly, JUnit times out.

  • 0

We have some tests that fail periodically for no reason, mainly, JUnit times out. I want to know if I can get the number of times each test has failed. With that, I can see if it is certain tests that keep have issues, or it is not tied to tricky tests and more an issue with the stability of Jenkins on that server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:35:47+00:00Added an answer on June 14, 2026 at 12:35 pm

    I encountered the same problems and we made a python that can grab the failings tests in the last N builds :

    # -*- coding: utf-8 -*-
    #! /usr/bin/python
    import urllib
    import re
    import sys
    
    project = "HERE_THE_PROJECT_NAME"
    jenkin_host = "http://path.to.your.jenkins/jenkins/job/%s" % project
    
    last_build = int(re.search("%s #(\d+)" % project, urllib.urlopen(jenkin_host + "/rssAll").read()).group(1))
    
    start_build = last_build
    nb_build = 200
    
    REG_EXP = """All Failed Tests(.*)All Tests"""
    FAILURE_REG_EXP = """javascript:hideStackTrace\(([^<]*)\)"""
    
    all_failures = {}
    last_seen = {}
    
    print "Loading %s builds starting from build number %s" % (nb_build, start_build)
    
    build_ok = 0
    
    for build_id in range(start_build - nb_build, start_build + 1):
        test_page = jenkin_host + "/%s/testReport/" % build_id
        sys.stdout.write(".")
        sys.stdout.flush()
        failures = set()
        for line in urllib.urlopen(test_page).readlines():
            line_piece = re.search(REG_EXP, line)
            if line_piece:
                piece = line_piece.group(1)
                match = re.search(FAILURE_REG_EXP, piece)
                while (match):
                    failures.add(match.group(1))
                    match = re.search(FAILURE_REG_EXP, piece[match.start():match.end()])
        if not failures:
            build_ok += 1
        for failure in failures:
            all_failures[failure] = all_failures.get(failure, 0) + 1
            last_seen[failure] = build_id
    print
    print "Done (found %s build OK)" % build_ok
    
    nbs = [ x for x in list(set(all_failures.values())) if x > 1]
    nbs.sort(reverse=True)
    
    for i in nbs:
        for test, nb in all_failures.iteritems():
            if nb == i :
                print "%d : %s (last seen : %s)" % (nb, test, last_seen[test])
    

    And I obtain :

    Loading 200 builds starting from build number 11032
    .........................................................................................................................................................................................................
    Done (found 148 build OK)
    8 : 'one failing test' (last seen : 10906)
    7 : 'another-failing-test' (last seen : 11019)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In XCode 4.2, I have some logic tests that I want to exercise against
I have a web application that I want to run some system tests on,
I have an extremely odd problem in my JUnit tests that I just can't
I have Junit 4.8.2 and maven 3 Some tests in my application should fail
I have some integration tests that get kicked off by TeamCity on a successful
I have some chart rendering tasks that I want to cover with tests. I
I have found that the following : <junit haltonfailure=no haltonerror=no > <!-- some tests
I have some unit tests that expects the 'current time' to be different than
I have some unit tests that I'm writing for a WPF application, and as
I have some Objective-C [i-os] code that I would like to run unit tests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.