Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
326 stars 206 forks source link

intermittent failure in liveslots/test/storeGC › lifecycle › store lifecycle 7 #10173

Open warner opened 4 days ago

warner commented 4 days ago

I observed an unexpected test failure in a PR (#10033) which did not make any changes that should have been able to affect a test. I think it's an intermittent misbehavior in the platform GC code (our old pals #3240 and #5575), but I need to look more carefully to be sure. I'm not able to reproduce it locally.

The test ran under Node 20.x . The NODE_V8_COVERAGE: coverage variable was set, in case that makes a difference. The CI run was in https://github.com/Agoric/agoric-sdk/actions/runs/11032275359/job/30640970790?pr=10033 but I expect that will be pruned fairly quickly. Test output is attached:

ok 183 - storeGC › refcount-management › remotable refcount management 2 %ava-dur=162ms
ok 184 - storeGC › lifecycle › store lifecycle 6 %ava-dur=277ms
not ok 185 - storeGC › lifecycle › store lifecycle 7 %ava-dur=177ms
  ---
    name: AssertionError
    assertion: is
    values:
      'Difference (- actual, + expected):': >-
        -
        '{"body":"#{\\"keyShape\\":{\\"#tag\\":\\"match:and\\",\\"payload\\":[{\\"#tag\\":\\"match:scalar\\",\\"payload\\":\\"#undefined\\"},{\\"#tag\\":\\"match:any\\",\\"payload\\":\\"#undefined\\"}]},\\"label\\":\\"store
        #6\\"}","slots":[]}'

        + undefined
    at: |-
      assertState (file://test/storeGC/lifecycle.test.js:56:7)
      file://test/storeGC/lifecycle.test.js:357:3
  ...
ok 186 - storeGC › lifecycle › store lifecycle 8 %ava-dur=232ms
ok 187 - storeGC › scalar-store-kind › assert known scalarMapStore ID %ava-dur=15ms
ok 188 - storeGC › weak-key › verify store weak key GC %ava-dur=80ms
warner commented 1 day ago

I haven't been able to reproduce this, but after an hour of repeating yarn test in swingset-liveslots, I did hit a (probably related) one:

  storeGC › weak-key › verify store weak key GC

  test/storeGC/weak-key.test.js:98

   97:   // nothing still references the dead 'held'
   98:   t.is(testHooks.countCollectionsForWeakKey(vref), 0); // Map8
   99:   // both the WeakMap and WeakSet have zero entries

  Difference (- actual, + expected):

  - 2
  + 0

  › file://test/storeGC/weak-key.test.js:98:5
warner commented 1 day ago

Patrick saw a few similar occurrences in virtual-objects › virtualObjectGC › VO lifecycle 4 faceted this week.