h-REA / hREA

A ValueFlows / REA economic network coordination system implemented on Holochain and with supplied Javascript GraphQL libraries
https://docs.hrea.io
Other
143 stars 15 forks source link

Failing test on intel based macos in `flows/flow_records_graphql.js` #274

Open Connoropolous opened 2 years ago

Connoropolous commented 2 years ago

This is specifically on Macos from what we can tell, for an unknown reason

Run WASM_LOG=debug RUST_LOG="debug,wasmer_compiler_cranelift=error,holochain::core::workflow=error," RUST_BACKTRACE=1 GRAPHQL_DEBUG=1 npx tape --ignore .skip_tests flows/flow_records_graphql.js

and get:

14:15:54 [tryorama] error: Test error: "TypeError: Cannot read properties of null (reading 'satisfies')\n" +
  '    at /Users/connor/code/hrea/test/flows/flow_records_graphql.js:353:25\n' +
  '    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n' +
  '    at p (/Users/connor/code/hrea/node_modules/.pnpm/@holochain+tryorama@0.4.10/node_modules/@holochain/tryorama/src/middleware.ts:126:29)'
not ok 42 Test threw an exception. See output for details.
  ---
    operator: fail
    at: <anonymous> (/Users/connor/code/hrea/node_modules/.pnpm/@holochain+tryorama@0.4.10/node_modules/@holochain/tryorama/src/middleware.ts:137:13)
    stack: |-
      Error: Test threw an exception. See output for details.
          at Test.assert [as _assert] (/Users/connor/code/hrea/node_modules/.pnpm/tape@4.15.0/node_modules/tape/lib/test.js:275:54)
          at Test.bound [as _assert] (/Users/connor/code/hrea/node_modules/.pnpm/tape@4.15.0/node_modules/tape/lib/test.js:89:32)
          at Test.fail (/Users/connor/code/hrea/node_modules/.pnpm/tape@4.15.0/node_modules/tape/lib/test.js:368:10)
          at Test.bound [as fail] (/Users/connor/code/hrea/node_modules/.pnpm/tape@4.15.0/node_modules/tape/lib/test.js:89:32)
          at /Users/connor/code/hrea/node_modules/.pnpm/@holochain+tryorama@0.4.10/node_modules/@holochain/tryorama/src/middleware.ts:137:13
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
  ...
14:15:54 [tryorama] debug: Test failed: flow records and relationships TypeError: Cannot read properties of null (reading 'satisfies')
    at /Users/connor/code/hrea/test/flows/flow_records_graphql.js:353:25
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at p (/Users/connor/code/hrea/node_modules/.pnpm/@holochain+tryorama@0.4.10/node_modules/@holochain/tryorama/src/middleware.ts:126:29) {
  [stack]: "TypeError: Cannot read properties of null (reading 'satisfies')\n" +
    '    at /Users/connor/code/hrea/test/flows/flow_records_graphql.js:353:25\n' +
    '    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n' +
    '    at p (/Users/connor/code/hrea/node_modules/.pnpm/@holochain+tryorama@0.4.10/node_modules/@holochain/tryorama/src/middleware.ts:126:29)',
  [message]: "Cannot read properties of null (reading 'satisfies')"
}

The related lines of code: https://github.com/h-REA/hREA/blob/c3ba5a4aa474cc2f8e8973e7655f647226d2c164/test/flows/flow_records_graphql.js#L353 and https://github.com/h-REA/hREA/blob/c3ba5a4aa474cc2f8e8973e7655f647226d2c164/test/flows/flow_records_graphql.js#L302-L314

pospi commented 2 years ago

That GraphQL request does run more mutations in parallel than possibly anywhere else in the tests. It could be a race-conditiony type thing where potentially something is happening too quickly, I've seen that before in older Holochain versions, from memory it was manifesting as a query starting on a cell before the DNA had finished installing. But this seems different- all those zomes have been hit by a request at this point in the test. Double-checking the presence of calls to await s.consistency() is also a thing worth investigating, but unlikely. And if you're in doubt about certain calls you can import waitForInput from init.js and use it with await in order to manually pause tests and allow backing services to settle.