private async Task BloatDbAsync(Context context, IMemoizationSession session)
        {
            uint dummyFingerprintsToAdd = 40; // generates a ~52KB DB file
            var  addBlock = new ActionBlock <int>(
                async _ =>
            {
                var strongFingerprint = StrongFingerprint.Random();
                var contentHashListWithDeterminism = new ContentHashListWithDeterminism(
                    ContentHashList.Random(), Determinism[DeterminismNone]);

                var result = await session.AddOrGetContentHashListAsync(
                    context, strongFingerprint, contentHashListWithDeterminism, Token);
                Assert.True(result.Succeeded);
            },
                new ExecutionDataflowBlockOptions {
                MaxDegreeOfParallelism = System.Environment.ProcessorCount
            });

            while (--dummyFingerprintsToAdd > 0)
            {
                await addBlock.SendAsync(0);
            }

            addBlock.Complete();
            await addBlock.Completion;
        }
        private static async Task AddOrGet(
            Context context, IMemoizationSession session, List <Record> records)
        {
            var tasks = Enumerable.Range(0, records.Count).Select(i => Task.Run(async() =>
            {
                var r = await session.AddOrGetContentHashListAsync(
                    context, records[i].StrongFingerprint, records[i].ContentHashListWithDeterminism, Token);
                r.Succeeded.Should().BeTrue();
                r.ContentHashListWithDeterminism.ContentHashList.Should().BeNull();
            }));

            await TaskSafetyHelpers.WhenAll(tasks);
        }
        private async Task <HashSet <StrongFingerprint> > AddRandomContentHashListsAsync(
            Context context, int count, IMemoizationSession session)
        {
            var strongFingerprints = new HashSet <StrongFingerprint>();

            for (int i = 0; i < count; i++)
            {
                var strongFingerprint = StrongFingerprint.Random();
                var contentHashListWithDeterminism = new ContentHashListWithDeterminism(ContentHashList.Random(), CacheDeterminism.None);
                await session.AddOrGetContentHashListAsync(context, strongFingerprint, contentHashListWithDeterminism, Token).ShouldBeSuccess();

                strongFingerprints.Add(strongFingerprint);
            }

            return(strongFingerprints);
        }