This is an automated email from the ASF dual-hosted git repository.

hgruszecki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new b03914cd3 fix(ci): prevent flaky keyring tests by deferring unlock to 
test phase (#2995)
b03914cd3 is described below

commit b03914cd3bfad0172e4d349a2460ef6e378745ec
Author: Hubert Gruszecki <[email protected]>
AuthorDate: Sat Mar 21 09:59:27 2026 +0100

    fix(ci): prevent flaky keyring tests by deferring unlock to test phase 
(#2995)
---
 .github/actions/rust/pre-merge/action.yml | 20 +++++++++++---------
 .github/workflows/post-merge.yml          | 13 ++++++++-----
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/.github/actions/rust/pre-merge/action.yml 
b/.github/actions/rust/pre-merge/action.yml
index 071ce5804..a47702cdf 100644
--- a/.github/actions/rust/pre-merge/action.yml
+++ b/.github/actions/rust/pre-merge/action.yml
@@ -108,15 +108,6 @@ runs:
     - name: Build and test with coverage
       if: inputs.task == 'test'
       run: |
-        # Start D-Bus and unlock keyring in the same shell that runs tests,
-        # so daemons are guaranteed alive for the entire test execution.
-        if [[ "$RUNNER_OS" == "Linux" ]]; then
-          eval $(dbus-launch --sh-syntax)
-          export DBUS_SESSION_BUS_ADDRESS
-          eval $(echo -n "test" | gnome-keyring-daemon --unlock 
--components=secrets)
-          echo -n "warmup" | secret-tool store --label="ci-warmup" ci-test 
warmup
-        fi
-
         source <(cargo llvm-cov show-env --export-prefix)
 
         bins_start=$(date +%s)
@@ -131,6 +122,17 @@ runs:
         compile_duration=$((compile_end - compile_start))
         echo "::notice::Tests compiled in ${compile_duration}s ($(date -ud 
@${compile_duration} +'%M:%S'))"
 
+        # Start D-Bus and unlock keyring right before test execution to avoid
+        # gnome-keyring auto-locking the collection during the build phase.
+        # Previously this ran before `cargo build`, leaving a 7+ minute idle
+        # window that triggered org.freedesktop.Secret.Error.IsLocked ~10% of 
runs.
+        if [[ "$RUNNER_OS" == "Linux" ]]; then
+          eval $(dbus-launch --sh-syntax)
+          export DBUS_SESSION_BUS_ADDRESS
+          eval $(echo -n "test" | gnome-keyring-daemon --unlock 
--components=secrets)
+          echo -n "warmup" | secret-tool store --label="ci-warmup" ci-test 
warmup
+        fi
+
         test_start=$(date +%s)
         if command -v cargo-nextest &> /dev/null; then
           cargo nextest run --locked --no-fail-fast
diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml
index 8f68f9a92..18c16eeba 100644
--- a/.github/workflows/post-merge.yml
+++ b/.github/workflows/post-merge.yml
@@ -203,16 +203,19 @@ jobs:
 
       - name: Build and test with coverage
         run: |
-          # Start D-Bus and unlock keyring in the same shell that runs tests,
-          # so daemons are guaranteed alive for the entire test execution.
+          source <(cargo llvm-cov show-env --export-prefix)
+          cargo build --locked
+          cargo test --locked --no-run
+
+          # Start D-Bus and unlock keyring right before test execution to avoid
+          # gnome-keyring auto-locking the collection during the build phase.
+          # Previously this ran before `cargo build`, leaving a 7+ minute idle
+          # window that triggered org.freedesktop.Secret.Error.IsLocked ~10% 
of runs.
           eval $(dbus-launch --sh-syntax)
           export DBUS_SESSION_BUS_ADDRESS
           eval $(echo -n "test" | gnome-keyring-daemon --unlock 
--components=secrets)
           echo -n "warmup" | secret-tool store --label="ci-warmup" ci-test 
warmup
 
-          source <(cargo llvm-cov show-env --export-prefix)
-          cargo build --locked
-          cargo test --locked --no-run
           if command -v cargo-nextest &> /dev/null; then
             cargo nextest run --locked --no-fail-fast
           else

Reply via email to