octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53254] tests: several unit tests set a random


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #53254] tests: several unit tests set a random "seed" or "state" without restoring it
Date: Thu, 1 Mar 2018 15:05:34 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0

URL:
  <http://savannah.gnu.org/bugs/?53254>

                 Summary: tests: several unit tests set a random "seed" or
"state" without restoring it
                 Project: GNU Octave
            Submitted by: mtmiller
            Submitted on: Thu 01 Mar 2018 12:05:33 PM PST
                Category: Test Suite
                Severity: 4 - Important
                Priority: 5 - Normal
              Item Group: Inaccurate Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

This is a test suite QA issue. Several of the unit tests set the random
generator "state" value without restoring it, or even worse, call rand("seed",
x), which according to the docs switches the internal algorithm, without
switching it back to the default.

This means all tests that follow the test in question and asking for random
values are not really getting random values, and may be getting values from
the old generator algorithm.

Through grepping, the following function unit tests have a call to rand
setting the "seed" or "state" value and not setting it back (additionally
setting the algorithm back if calling "seed"):

* libinterp/corefcn/conv2.cc
* scripts/sparse/eigs.m
* scripts/statistics/median.m

It would not hurt to look at other functions that set and restore the random
generator state to make sure they are doing it safely and consistently. Some
functions use an unwind_protect block and some use an onCleanup function, for
example.

It wouldn't hurt to also double check the tests in libinterp/corefcn/rand.cc
to make sure they are doing the right thing.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]