diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 79464e219..8d9f7dcbb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -50,7 +50,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@d90b8d79de6dc1f58e83a1499aa58d6c93dc28de # v2.22.2 + uses: github/codeql-action/init@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -60,7 +60,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@d90b8d79de6dc1f58e83a1499aa58d6c93dc28de # v2.22.2 + uses: github/codeql-action/autobuild@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -73,6 +73,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@d90b8d79de6dc1f58e83a1499aa58d6c93dc28de # v2.22.2 + uses: github/codeql-action/analyze@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 10ad96cf7..9621f66a3 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@d90b8d79de6dc1f58e83a1499aa58d6c93dc28de # v2.13.4 + uses: github/codeql-action/upload-sarif@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 with: sarif_file: results.sarif diff --git a/tests/at_functional_test/test/check_docker_readiness.dart b/tests/at_functional_test/test/check_docker_readiness.dart index c0bffe31c..c7486367d 100644 --- a/tests/at_functional_test/test/check_docker_readiness.dart +++ b/tests/at_functional_test/test/check_docker_readiness.dart @@ -16,15 +16,19 @@ void main() { test('checking for test environment readiness', () async { _secureSocket = await secure_socket_connection(rootServer, atsignPort); - print('connection established'); socket_listener(_secureSocket); String response = ''; - while (response.isEmpty || response == 'data:null\n') { + while ((retryCount < maxRetryCount) && + (response.isEmpty || response == 'data:null\n')) { _secureSocket.write('lookup:signing_publickey$atsign\n'); response = await read(); print('waiting for signing public key response : $response'); await Future.delayed(Duration(milliseconds: 100)); + if (response.startsWith('data:')) { + break; + } } await _secureSocket.close(); - }, timeout: Timeout(Duration(minutes: 1))); + expect(response.startsWith('data:'), true); + }); } diff --git a/tests/at_functional_test/test/check_root_server_readiness.dart b/tests/at_functional_test/test/check_root_server_readiness.dart index 2dfcef06a..88bd3ce28 100644 --- a/tests/at_functional_test/test/check_root_server_readiness.dart +++ b/tests/at_functional_test/test/check_root_server_readiness.dart @@ -15,6 +15,8 @@ void main() { late SecureSocket _secureSocket; + bool isRootServerStarted = false; + test('checking for root server readiness', () async { while (retryCount < maxRetryCount) { try { @@ -25,16 +27,17 @@ void main() { if (response == '@') { print('Secure Socket is open for Root Server'); } - var isRootServerStarted = - await _lookupForSecondaryAddress(_secureSocket, atSign, rootServer); + isRootServerStarted = + await _lookupForSecondaryAddress(_secureSocket, atSign, rootServer); if (isRootServerStarted) { - print('Closing socket connection'); + print('Root server started successfully'); _secureSocket.close(); break; } else { - print('Failed to start root server'); + print('Root server is not completely initialized'); _secureSocket.close(); - break; + retryCount = retryCount + 1; + await Future.delayed(Duration(seconds: 5)); } } on SocketException { print('Waiting for the root server to start: RetryCount: $retryCount'); @@ -46,6 +49,7 @@ void main() { retryCount = retryCount + 1; } } + expect(isRootServerStarted, true, reason: 'Failed to start root server successfully'); }, timeout: Timeout(Duration(minutes: 1))); } diff --git a/tests/at_functional_test/test/check_test_env.dart b/tests/at_functional_test/test/check_test_env.dart index 85e8d76f5..f07584447 100644 --- a/tests/at_functional_test/test/check_test_env.dart +++ b/tests/at_functional_test/test/check_test_env.dart @@ -9,18 +9,28 @@ void main() { var rootServer = 'vip.ve.atsign.zone'; var atsign = '@sitaram🛠'; var atsignPort = 25017; + bool arePKAMKeysLoaded = false; + int maxRetryCount = 10; + int retryCount = 1; test('checking for test environment readiness', () async { _secureSocket = await secure_socket_connection(rootServer, atsignPort); print('connection established'); socket_listener(_secureSocket); String response = ''; - while (response.isEmpty || response.startsWith('error:')) { + while ((retryCount < maxRetryCount) && + (response.isEmpty || response.startsWith('error:'))) { _secureSocket.write('lookup:pkaminstalled$atsign\n'); response = await read(); print('Waiting for PKAM keys to load : $response'); + if (response.startsWith('data:')) { + arePKAMKeysLoaded = true; + break; + } await Future.delayed(Duration(seconds: 1)); } await _secureSocket.close(); - }, timeout: Timeout(Duration(minutes: 1))); + expect(arePKAMKeysLoaded, true, + reason: 'PKAM Keys are not loaded successfully'); + }); }