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: Intermittent failure in create_update_key_test.dart #2134

Merged
Merged
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
12 changes: 9 additions & 3 deletions tests/at_functional_test/test/create_update_key_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ void main() {
await firstAtSignConnection.initiateConnectionWithListener(
firstAtSign, firstAtSignHost, firstAtSignPort);
String authResponse = await firstAtSignConnection.authenticateConnection();
expect(authResponse, 'data:success', reason: 'Authentication failed when executing test');
expect(authResponse, 'data:success',
reason: 'Authentication failed when executing test');
});

setUp(() {
Expand Down Expand Up @@ -50,7 +51,7 @@ void main() {
expect(atData['metaData']['version'], 0);
expect(
DateTime.parse(atData['metaData']['createdAt'])
.millisecondsSinceEpoch >
.millisecondsSinceEpoch >=
keyCreationDateTime.millisecondsSinceEpoch,
true);
expect(atData['metaData']['createdBy'], firstAtSign);
Expand Down Expand Up @@ -104,6 +105,7 @@ void main() {
var commitIDValue = jsonDecode(jsonData[0]['value']);
int noOfTests = 5;
late String response;

/// UPDATE VERB
for (int i = 1; i <= noOfTests; i++) {
response = await firstAtSignConnection.sendRequestToServer(
Expand All @@ -114,12 +116,15 @@ void main() {
// sync
response = await firstAtSignConnection.sendRequestToServer(
'sync:from:${commitIDValue - 1}:limit:$noOfTests');
expect('public:location-$uniqueId$firstAtSign'.allMatches(response).length, 1);
expect(
'public:location-$uniqueId$firstAtSign'.allMatches(response).length,
1);
});

test('delete same key multiple times test', () async {
int noOfTests = 3;
late String response;

/// Delete VERB
for (int i = 1; i <= noOfTests; i++) {
response = await firstAtSignConnection
Expand All @@ -134,6 +139,7 @@ void main() {
late String response;
var atKey = 'public:key-$uniqueId';
var atValue = 'val';

/// UPDATE VERB
for (int i = 1, j = 1; i <= noOfTests; i++, j++) {
response = await firstAtSignConnection
Expand Down