Changeset 290900 in webkit


Ignore:
Timestamp:
Mar 7, 2022, 11:27:00 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

LayoutTests/webgl/max-active-contexts-gc.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=237466

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2022-03-07
Reviewed by Alexey Proskuryakov.
The test:

  • created 16 WebGL contexts
  • unreferenced 8 WebGL contexts.
  • forced gc
  • added 9 WebGL contexts.

The test tries to test that GC removes unreferenced contexts.
To assert this, it ends up with 17 contexts, which is 1 above
the maximum active limit. This means one context is lost and the
implementation prints one line of error.

Since the GC is not exact, sometimes it would only collect 7 of the 8
unreferenced contexts. This would mean two error messages.

Fix by trying to collect each time a context is unreferenced. This seems to be
more predictable.

  • webgl/max-active-contexts-gc.html:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r290899 r290900  
     12022-03-07  Kimmo Kinnunen  <kkinnunen@apple.com>
     2
     3        LayoutTests/webgl/max-active-contexts-gc.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=237466
     5
     6        Reviewed by Alexey Proskuryakov.
     7        The test:
     8         - created 16 WebGL contexts
     9         - unreferenced 8 WebGL contexts.
     10         - forced gc
     11         - added 9 WebGL contexts.
     12        The test tries to test that GC removes unreferenced contexts.
     13        To assert this, it ends up with 17 contexts, which is 1 above
     14        the maximum active limit. This means one context is lost and the
     15        implementation prints one line of error.
     16
     17        Since the GC is not exact, sometimes it would only collect 7 of the 8
     18        unreferenced contexts. This would mean two error messages.
     19
     20        Fix by trying to collect each time a context is unreferenced. This seems to be
     21        more predictable.
     22
     23        * webgl/max-active-contexts-gc.html:
     24
    1252022-03-07  Chris Dumez  <cdumez@apple.com>
    226
  • trunk/LayoutTests/webgl/max-active-contexts-gc.html

    r199819 r290900  
    11<script>
    2 function forceGC() {
     2function collect() {
     3    if (window.GCController) {
     4        GCController.collect();
     5        return;
     6    }
    37    try {
    48        for (var ndx = 0; ndx < 99000; ndx++)
     
    2529
    2630// Now remove some of those contexts from this array so they may be garbage collected.
    27 while (contexts.length > contextsToKeep)
     31while (contexts.length > contextsToKeep) {
    2832    contexts.shift();
     33    collect();
     34}
    2935
     36// Add contexts until we get to the limit then add one more. This should only
     37// produce a single warning that an older context will be lost.
    3038setTimeout(function() {
    31     if (window.GCController)
    32         GCController.collect();
    33     else
    34         forceGC();
    35 
    36     // Add contexts until we get to the limit then add one more. This should only
    37     // produce a single warning that an older context will be lost.
    38     setTimeout(function() {
    39         while (contexts.length < maxNumberOfActiveContexts + 1)
    40             addContext();
    41 
    42         if (window.testRunner)
    43             testRunner.notifyDone();
    44     });
     39    while (contexts.length < maxNumberOfActiveContexts + 1)
     40        addContext();
     41    if (window.testRunner)
     42        testRunner.notifyDone();
    4543});
    4644
Note: See TracChangeset for help on using the changeset viewer.