Yarn run testunit failing by default

Description

Hi there, Can anyone help me with this date error I am facing while I am trying to run yarn run testunit.

I am using fedora 37.

logs:

@rocket.chat/meteor:testunit:   1495 passing (1s)
@rocket.chat/meteor:testunit:   6 pending
@rocket.chat/meteor:testunit:   5 failing
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:   1) Sessions Aggregates
@rocket.chat/meteor:testunit:        "before all" hook for "should have sessions_dates data saved":
@rocket.chat/meteor:testunit:      Error: Instance Exited before being ready and without throwing an error!
@rocket.chat/meteor:testunit:       at MongoInstance.<anonymous> (node_modules/mongodb-memory-server-core/src/util/MongoInstance.ts:338:13)
@rocket.chat/meteor:testunit:       at MongoInstance.emit (domain.js:475:12)
@rocket.chat/meteor:testunit:       at MongoInstance.closeHandler (node_modules/mongodb-memory-server-core/src/util/MongoInstance.ts:513:10)
@rocket.chat/meteor:testunit:       at ChildProcess.emit (domain.js:475:12)
@rocket.chat/meteor:testunit:       at maybeClose (internal/child_process.js:1088:16)
@rocket.chat/meteor:testunit:       at Socket.<anonymous> (internal/child_process.js:446:11)
@rocket.chat/meteor:testunit:       at Socket.emit (domain.js:475:12)
@rocket.chat/meteor:testunit:       at Pipe.<anonymous> (net.js:686:12)
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:   2) Sessions Aggregates
@rocket.chat/meteor:testunit:        "after all" hook for "should have 2 unique OS for the week ending on 5/7 of 2019":
@rocket.chat/meteor:testunit:      TypeError: Cannot read property 'stop' of undefined
@rocket.chat/meteor:testunit:       at Context.<anonymous> (tests/unit/app/models/server/raw/Sessions.tests.js:262:17)
@rocket.chat/meteor:testunit:       at processImmediate (internal/timers.js:464:21)
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:   3) parseMessageSearchQuery
@rocket.chat/meteor:testunit:        should parse "before:01-01-2023":
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:       AssertionError: expected { Object (ts) } to deeply equal { Object (ts) }
@rocket.chat/meteor:testunit:       + expected - actual
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:        {
@rocket.chat/meteor:testunit:          "ts": {
@rocket.chat/meteor:testunit:       -    "$lte": [Date: 2022-12-31T12:30:00.000Z]
@rocket.chat/meteor:testunit:       +    "$lte": [Date: 2022-12-31T13:30:00.000Z]
@rocket.chat/meteor:testunit:          }
@rocket.chat/meteor:testunit:        }
@rocket.chat/meteor:testunit:       
@rocket.chat/meteor:testunit:       at Context.<anonymous> (tests/unit/server/lib/parseMessageSearchQuery.spec.ts:111:26)
@rocket.chat/meteor:testunit:       at processImmediate (internal/timers.js:464:21)
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:   4) parseMessageSearchQuery
@rocket.chat/meteor:testunit:        should parse "after:01-01-2023":
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:       AssertionError: expected { Object (ts) } to deeply equal { Object (ts) }
@rocket.chat/meteor:testunit:       + expected - actual
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:        {
@rocket.chat/meteor:testunit:          "ts": {
@rocket.chat/meteor:testunit:       -    "$gte": [Date: 2023-01-01T12:30:00.000Z]
@rocket.chat/meteor:testunit:       +    "$gte": [Date: 2023-01-01T13:30:00.000Z]
@rocket.chat/meteor:testunit:          }
@rocket.chat/meteor:testunit:        }
@rocket.chat/meteor:testunit:       
@rocket.chat/meteor:testunit:       at Context.<anonymous> (tests/unit/server/lib/parseMessageSearchQuery.spec.ts:111:26)
@rocket.chat/meteor:testunit:       at processImmediate (internal/timers.js:464:21)
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:   5) parseMessageSearchQuery
@rocket.chat/meteor:testunit:        should parse "on:01-01-2023":
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:       AssertionError: expected { ts: { …(2) } } to deeply equal { ts: { …(2) } }
@rocket.chat/meteor:testunit:       + expected - actual
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit:        {
@rocket.chat/meteor:testunit:          "ts": {
@rocket.chat/meteor:testunit:       -    "$gte": [Date: 2022-12-31T12:30:00.000Z]
@rocket.chat/meteor:testunit:       -    "$lt": [Date: 2023-01-01T12:30:00.000Z]
@rocket.chat/meteor:testunit:       +    "$gte": [Date: 2022-12-31T13:30:00.000Z]
@rocket.chat/meteor:testunit:       +    "$lt": [Date: 2023-01-01T13:30:00.000Z]
@rocket.chat/meteor:testunit:          }
@rocket.chat/meteor:testunit:        }
@rocket.chat/meteor:testunit:       
@rocket.chat/meteor:testunit:       at Context.<anonymous> (tests/unit/server/lib/parseMessageSearchQuery.spec.ts:111:26)
@rocket.chat/meteor:testunit:       at processImmediate (internal/timers.js:464:21)
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit: npm ERR! code ELIFECYCLE
@rocket.chat/meteor:testunit: npm ERR! errno 5
@rocket.chat/meteor:testunit: npm ERR! @rocket.chat/meteor@6.2.0-develop .testunit:server: `TS_NODE_COMPILER_OPTIONS='{"module": "commonjs"}' mocha --config ./.mocharc.js`
@rocket.chat/meteor:testunit: npm ERR! Exit status 5
@rocket.chat/meteor:testunit: npm ERR! 
@rocket.chat/meteor:testunit: npm ERR! Failed at the @rocket.chat/meteor@6.2.0-develop .testunit:server script.
@rocket.chat/meteor:testunit: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@rocket.chat/meteor:testunit: 
@rocket.chat/meteor:testunit: npm ERR! A complete log of this run can be found in:
@rocket.chat/meteor:testunit: npm ERR!     /home/ravijyoti/.npm/_logs/2023-04-13T22_49_43_598Z-debug.log
@rocket.chat/meteor:testunit: ERROR: command finished with error: command (apps/meteor) yarn run testunit exited (5)
command (apps/meteor) yarn run testunit exited (5)

 Tasks:    36 successful, 37 total
Cached:    35 cached, 37 total
  Time:    5m24.791s 

Server Setup Information

  • Version of Rocket.Chat Server: 6.2.0-develop
  • Operating System: Fedora 37
  • Deployment Method:
  • Number of Running Instances:
  • DB Replicaset Oplog:
  • NodeJS Version: 14.21.3
  • MongoDB Version:
  • Proxy:
  • Firewalls involved:

Any additional Information

were you able to solve the issue here ?

I was able to solve this issue by changing the timezone to UTC. It’s kind of a hack but it works !