bugGNU Octave - Bugs: bug #59038, test failure (regression) with...

 
 

bug #59038: test failure (regression) with legend.m on Windows 10

Submitted by:  Hartmut <hardy>
Submitted on:  Sat 29 Aug 2020 04:23:41 PM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  6.0.90 Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Tue 15 Sep 2020 02:27:04 PM UTC, comment #10: 

I can confirm that the adapted unit test (commenht #9 and already pushed) now POASSes on my Win10 PC despite my mentioned font size settings in startup.m.

Thank you for the patch.

Hartmut <hardy>
Mon 14 Sep 2020 04:20:04 PM UTC, comment #9: 

I checked in a change to make this particular BIST test resistant to changes in DefaultAxesFontSize.  See http://hg.savannah.gnu.org/hgweb/octave/rev/f98fd55b9557.

Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Mon 14 Sep 2020 03:46:32 PM UTC, comment #8: 

I've checked my "problematic" startup.m file. And it is a single code line herein that generates the test failure: set(0, "defaultaxesfontsize", 16)

So the following gives a failing test result:

set(0, "defaultaxesfontsize", 16)
test legend

Markus' suggestion in comment #7 does unfortunatelly NOT fix this problem in my special case, still the same test failure occurs. I also tried the line "hl = legend ("Legend Text", "units", "normalized", "fontsize", 10);", but it did not make the test pass for me.

So, if we find a more robust formulation of this unit test, that is more independent of possible user settings, I would also like to see this. Maybe someone with more insight into the different fontsize and plot properties could help here?

Hartmut <hardy>
Mon 14 Sep 2020 10:29:58 AM UTC, comment #7: 

It might be preferable to make the test more resilient against local settings. That could, e.g., be done by temporarily resetting the necessary (default) properties. Or we could explicitly set the necessary properties in the test. E.g., `axes ("units", "normalized", "fontsize", 10);`

Does the linewidth make a difference?

Re-opening report.

Markus M├╝tzel <mmuetzel>
Project Member
Mon 14 Sep 2020 09:54:22 AM UTC, comment #6: 

Thank you for the feedback.  Close as "invalid."

Kai Torben Ohlhus <siko1056>
Project Member
Mon 14 Sep 2020 08:57:39 AM UTC, comment #5: 

I have now found the reason for this failing test on two Win10 computers: On both computers I had a startup.m (octaverc) file present, that changed the figure default fontsize and linewidth.

After deleting this startup.m file (there seems to be no easier way for a "clean" start of Octave under Windows) all tests of legend.m now pass.

So please go ahead to CLOSE this bug report, probalbly as "invalid".

Hartmut <hardy>
Tue 01 Sep 2020 08:11:35 PM UTC, comment #4: 

Oops, I somehow missed that you were already running 'test legend' by itself.

Other things to check:

1) Are you somewhow using gnuplot, rather than qt as the graphics toolkit?

2) If you copy the code into it's own m-file and run it, does it still have a problem or is it only when run serially amidst all the other legend BIST tests?  I've attached the necessary file.

3) If you put in a delay using pause() after changing the fontsize does it work?  (Maybe the callbacks which change the "position" property are still working when the function call to get the "position" occurs.

(file #49732)

Rik <rik5>
Project Administrator
Tue 01 Sep 2020 06:52:17 AM UTC, comment #3: 

Yes, "test legend" also fails. (See code output in comment #0.)

Hartmut <hardy>
Tue 01 Sep 2020 12:00:35 AM UTC, comment #2: 

Does it fail if you run the tests directly from the command line rather than as part of the test suite (_run_test_suite_)?  For example, if you start Octave and execute

test legend

, does that work?

Rik <rik5>
Project Administrator
Sat 29 Aug 2020 07:14:39 PM UTC, comment #1: 

I have now observed the same test failure on a second Win10 machine, with totally different hardware and also a different Version of Win10. The precise numbers a slightly different, so I present them here again:

>>>>> processing C:\Octave\Octave-6.0.90\mingw64\share\octave\6.0.90\m\plot\appearance\legend.m
***** testif HAVE_FREETYPE <*40333>
hf = figure ("visible", "off");
unwind_protect
   axes ("units", "normalized");
   plot (1:10);
   hl = legend ("Legend Text", "units", "normalized");
   pos = get (gca, 'position');
   set (hf, 'position', [0, 0, 200, 200]);
   set (hl, 'fontsize', 20);
   assert (get (gca, 'position'), pos, 2*eps);
unwind_protect_cleanup
   close (hf);
end_unwind_protect
!!!!! regression: https://octave.org/testfailure/?40333
ASSERT errors for:  assert (get (gca, 'position'),pos,2 * eps)

  Location  |  Observed  |  Expected  |  Reason
    (1)         0.155         0.13       Abs err 0.025 exceeds tol 4.4409e-16 by 0.02
    (2)          0.15         0.11       Abs err 0.04 exceeds tol 4.4409e-16 by 0.04
    (3)          0.75        0.775       Abs err 0.025 exceeds tol 4.4409e-16 by 0.02
    (4)         0.775        0.815       Abs err 0.04 exceeds tol 4.4409e-16 by 0.04

The only common thing I can imagine is, that both times I have installed Octave into a non-standard program path. Now it was "C:\Octave", and before it was "D:\myname\Octave-installation".

Can other people reproduce this test failure?

Hartmut <hardy>
Sat 29 Aug 2020 04:23:41 PM UTC, original submission:  

I have installed the current release candidate (octave-6.0.90a-w64-installer.exe) on a Win 10 machine. I started Octave with the shortcut icon on the desktop. Running the test suite gives me one "regression" and one "test failure". This bug report ist about the regression on legend.m.

Here is the output of a later test run on legend.m:

>> test legend
***** testif HAVE_FREETYPE <*40333>
hf = figure ("visible", "off");
unwind_protect
   axes ("units", "normalized");
   plot (1:10);
   hl = legend ("Legend Text", "units", "normalized");
   pos = get (gca, 'position');
   set (hf, 'position', [0, 0, 200, 200]);
   set (hl, 'fontsize', 20);
   assert (get (gca, 'position'), pos, 2*eps);
unwind_protect_cleanup
   close (hf);
end_unwind_protect
!!!!! regression: https://octave.org/testfailure/?40333
ASSERT errors for:  assert (get (gca, 'position'),pos,2 * eps)

  Location  |  Observed  |  Expected  |  Reason
    (1)          0.14         0.13       Abs err 0.01 exceeds tol 4.4409e-16 by 0.01
    (2)         0.1325        0.11       Abs err 0.0225 exceeds tol 4.4409e-16 by 0.02
    (3)         0.765        0.775       Abs err 0.01 exceeds tol 4.4409e-16 by 0.01
    (4)         0.7925       0.815       Abs err 0.0225 exceeds tol 4.4409e-16 by 0.02
PASSES 7 out of 8 tests

Hartmut <hardy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #49732:  tst_59038.m added by rik5 (359B - text/x-matlab)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by hardy (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-14 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2020-09-14 mmuetzel StatusInvalid => Confirmed
        Open/ClosedClosed => Open
    2020-09-14 siko1056 StatusNeed Info => Invalid
        Open/ClosedOpen => Closed
    2020-09-01 rik5 Attached File- => Added tst_59038.m, #49732
    2020-09-01 rik5 StatusNone => Need Info

    Back to the top


    Powered by Savane 3.5