Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add a sleep in a list test to fix an intermittent canary failure #573

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/Integration/Momento.Sdk.Tests/Cache/DictionaryTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Momento.Sdk.Internal.ExtensionMethods;
using Momento.Sdk.Requests;
Expand Down Expand Up @@ -863,8 +864,10 @@ public async Task CacheDictionaryFetchResponse_ToString_HappyPath()
{
var dictionaryName = Utils.NewGuidString();
await client.DictionarySetFieldAsync(cacheName, dictionaryName, "a", "b");

Thread.Sleep(100);

CacheDictionaryFetchResponse fetchResponse = await client.DictionaryFetchAsync(cacheName, dictionaryName);
var fetchResponse = await client.DictionaryFetchAsync(cacheName, dictionaryName);

Assert.True(fetchResponse is CacheDictionaryFetchResponse.Hit, $"Unexpected response: {fetchResponse}");
var hitResponse = (CacheDictionaryFetchResponse.Hit)fetchResponse;
Expand Down
10 changes: 6 additions & 4 deletions tests/Integration/Momento.Sdk.Tests/Cache/ListTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Momento.Sdk.Internal.ExtensionMethods;
using Momento.Sdk.Requests;
Expand Down Expand Up @@ -706,14 +707,13 @@ public async Task ListPushFrontFetch_ValueIsString_HappyPath()
var listName = Utils.NewGuidString();
var value1 = Utils.NewGuidString();

CacheListPushFrontResponse pushResponse = await client.ListPushFrontAsync(cacheName, listName, value1);
var pushResponse = await client.ListPushFrontAsync(cacheName, listName, value1);
Assert.True(pushResponse is CacheListPushFrontResponse.Success, $"Unexpected response: {pushResponse}");
var successResponse = (CacheListPushFrontResponse.Success)pushResponse;
Assert.Equal(1, successResponse.ListLength);
Assert.Equal("Momento.Sdk.Responses.CacheListPushFrontResponse+Success: ListLength: 1", successResponse.ToString());
successResponse = (CacheListPushFrontResponse.Success)pushResponse;

CacheListFetchResponse fetchResponse = await client.ListFetchAsync(cacheName, listName);
var fetchResponse = await client.ListFetchAsync(cacheName, listName);
Assert.True(fetchResponse is CacheListFetchResponse.Hit, $"Unexpected response: {fetchResponse}");
var hitResponse = (CacheListFetchResponse.Hit)fetchResponse;

Expand All @@ -727,7 +727,9 @@ public async Task ListPushFrontFetch_ValueIsString_HappyPath()
Assert.True(pushResponse is CacheListPushFrontResponse.Success, $"Unexpected response: {pushResponse}");
successResponse = (CacheListPushFrontResponse.Success)pushResponse;
Assert.Equal(2, successResponse.ListLength);


Thread.Sleep(100);

fetchResponse = await client.ListFetchAsync(cacheName, listName);
Assert.True(fetchResponse is CacheListFetchResponse.Hit, $"Unexpected response: {fetchResponse}");
hitResponse = (CacheListFetchResponse.Hit)fetchResponse;
Expand Down
Loading