Skip to content

Commit

Permalink
Merge pull request #2134 from atsign-foundation/2132-functional-tests…
Browse files Browse the repository at this point in the history
…-failing-in-stable-and-beta

fix: Intermittent failure in create_update_key_test.dart
  • Loading branch information
sitaram-kalluri authored Oct 17, 2024
2 parents e58bd32 + 57c12ac commit aedef47
Showing 1 changed file with 9 additions and 3 deletions.
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

0 comments on commit aedef47

Please sign in to comment.