I have tests that generate unique dynamodb tables (with streams enabled) for each test (to provide isolation) and keep running into Math.random() with tests timing out. After bash'ing into the docker container and force killing various services, I narrowed it down to kinesalite.

An easy way to reproduce isrun it within sharedLimit = 1 like so:
`node /opt/code/localstack/localstack/node_modules/kinesalite/cli.js --shardLimit 1 --port 4565`

Doing so causes dynamodb.createTable commands to hang after a few tries.
port = port or config.PORT_KINESIS
    install.install_kinesalite()
    backend_port = DEFAULT_PORT_KINESIS_BACKEND
    kinesis_data_dir_param = ''
    if config.DATA_DIR:
        kinesis_data_dir = '%s/kinesis' % config.DATA_DIR
        mkdir(kinesis_data_dir)
        kinesis_data_dir_param = '--path %s' % kinesis_data_dir
    cmd = ('%s/node_modules/kinesalite/cli.js --shardLimit %s --port %s %s' %
        (ROOT_PATH, shard_limit, backend_port, kinesis_data_dir_param))
    print('Starting mock Kinesis (%s port %s)...' % (get_service_protocol(), port))
    start_proxy_for_service('kinesis', port, backend_port, update_listener)
    return do_run(cmd, asynchronous)
def check_kinesis(expect_shutdown=False, print_error=False):
    out = None
    try:
        
        out = aws_stack.connect_to_service(service_name='kinesis').list_streams()
    except Exception as e:
        if print_error:
            LOGGER.error('Kinesis health check failed: %s %s' % (e, traceback.format_exc()))
    if expect_shutdown:
        assert out is None
    else:
        assert isinstance(out['StreamNames'], list)