Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9367

TestInjection's use of a static Random means that sequences of events can be diff for the same test seed depending on wether individual methods are run, or entire test classes, or multiple classes in the same slave JVM

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      While digging through SOLR-9363, I realized that the reason the failures reproduced when running the entire -Dtestcase but not the individual -Dtests.method was because TestInjection was behaving differently in those cases.

      This is because TestInjection uses a static Random instance – allthough it is initialized based on the tests.seed sysprop to try to be reproducible, it's behavior still very much depends on how many testcases are run in that slave JVM, and/or how many test methods are run.

        Issue Links

          Activity

          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit c17605b4a9978311b6b231f202d70dd800e473e6 in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c17605b ]

          SOLR-9363: tweak test to work around SOLR-9366 + SOLR-9367 since those issues are not key to what's being tested here

          (cherry picked from commit 04321c401c6584395c76c509f8513c5e5e4730ee)

          Show
          jira-bot ASF subversion and git services added a comment - Commit c17605b4a9978311b6b231f202d70dd800e473e6 in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c17605b ] SOLR-9363 : tweak test to work around SOLR-9366 + SOLR-9367 since those issues are not key to what's being tested here (cherry picked from commit 04321c401c6584395c76c509f8513c5e5e4730ee)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 04321c401c6584395c76c509f8513c5e5e4730ee in lucene-solr's branch refs/heads/master from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=04321c4 ]

          SOLR-9363: tweak test to work around SOLR-9366 + SOLR-9367 since those issues are not key to what's being tested here

          Show
          jira-bot ASF subversion and git services added a comment - Commit 04321c401c6584395c76c509f8513c5e5e4730ee in lucene-solr's branch refs/heads/master from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=04321c4 ] SOLR-9363 : tweak test to work around SOLR-9366 + SOLR-9367 since those issues are not key to what's being tested here
          Hide
          hossman Hoss Man added a comment -

          attaching my strawman proposed fix... anybody else have a better suggestion?

          Show
          hossman Hoss Man added a comment - attaching my strawman proposed fix... anybody else have a better suggestion?
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 8ad1a830fbe08e37eac50cf875edc9b889363524 in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8ad1a83 ]

          SOLR-9367: Improved TestInjection's randomization logic to use LuceneTestCase.random()

          (cherry picked from commit 84a8c098fca2018ca8c6abde13ae0d56f081dae1)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 8ad1a830fbe08e37eac50cf875edc9b889363524 in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8ad1a83 ] SOLR-9367 : Improved TestInjection's randomization logic to use LuceneTestCase.random() (cherry picked from commit 84a8c098fca2018ca8c6abde13ae0d56f081dae1)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 84a8c098fca2018ca8c6abde13ae0d56f081dae1 in lucene-solr's branch refs/heads/master from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=84a8c09 ]

          SOLR-9367: Improved TestInjection's randomization logic to use LuceneTestCase.random()

          Show
          jira-bot ASF subversion and git services added a comment - Commit 84a8c098fca2018ca8c6abde13ae0d56f081dae1 in lucene-solr's branch refs/heads/master from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=84a8c09 ] SOLR-9367 : Improved TestInjection's randomization logic to use LuceneTestCase.random()
          Hide
          mikemccand Michael McCandless added a comment -

          Bulk close resolved issues after 6.2.0 release.

          Show
          mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

            People

            • Assignee:
              hossman Hoss Man
              Reporter:
              hossman Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development