fraction / oasis

Free, open-source, peer-to-peer social application that helps you follow friends and discover new ones on Secure Scuttlebutt (SSB).
http://oasis-demo.fraction.io
GNU Affero General Public License v3.0
287 stars 42 forks source link

Fix tests and remove workaround #465

Closed christianbundy closed 3 years ago

christianbundy commented 3 years ago

What's the problem you solved?

Problem: Recently there was a PR 0 merged with a quickfix to avoid some test failures, which is something I've been trying to avoid. While process.exit() works fine, I'm worried that it means we don't understand what's happening under the hood, plus I have the [maybe unjustified?] worry that it might kill the process during a database write or something dangerous. It looks like this particular test hang was caused by both a stream and some number of intervals that were left open.

What solution are you recommending?

Solution: Provide a way to close the stream and intervals in index.js and ensure that we do that before closing the server.

cc: @cryptix @cblgh @black-puppydog @cinnamon-bun

christianbundy commented 3 years ago

Self-merging.