From 98430db58fbbe27f2a8f260b3aad78851b1e83f4 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Fri, 23 Jan 2026 10:05:32 -0500 Subject: [PATCH 1/2] Collect operator logs on timeout (#16239) * Collect operator logs on timeout * Set timeout back to prod value * Add e to the bash with timeout block --- .github/workflows/ci.yml | 48 +++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a203fbc1c..9f99f95b62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -207,27 +207,59 @@ jobs: - name: Run test deployment with awx-operator working-directory: awx-operator + id: awx_operator_test + timeout-minutes: 60 + continue-on-error: true run: | - python -m pip install -r molecule/requirements.txt - python -m pip install PyYAML # for awx/tools/scripts/rewrite-awx-operator-requirements.py - $(realpath ../awx/tools/scripts/rewrite-awx-operator-requirements.py) molecule/requirements.yml $(realpath ../awx) - ansible-galaxy collection install -r molecule/requirements.yml - sudo rm -f $(which kustomize) - make kustomize - KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule -v test -s kind -- --skip-tags=replicas + set +e + timeout 54m bash -elc ' + python -m pip install -r molecule/requirements.txt + python -m pip install PyYAML # for awx/tools/scripts/rewrite-awx-operator-requirements.py + $(realpath ../awx/tools/scripts/rewrite-awx-operator-requirements.py) molecule/requirements.yml $(realpath ../awx) + ansible-galaxy collection install -r molecule/requirements.yml + sudo rm -f $(which kustomize) + make kustomize + KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule -v test -s kind -- --skip-tags=replicas + ' + rc=$? + if [ $rc -eq 124 ]; then + echo "timed_out=true" >> "$GITHUB_OUTPUT" + fi + exit $rc env: AWX_TEST_IMAGE: local/awx AWX_TEST_VERSION: ci AWX_EE_TEST_IMAGE: quay.io/ansible/awx-ee:latest STORE_DEBUG_OUTPUT: true + - name: Collect awx-operator logs on timeout + # Only run on timeout; normal failures should use molecule's built-in log collection. + if: steps.awx_operator_test.outputs.timed_out == 'true' + run: | + mkdir -p "$DEBUG_OUTPUT_DIR" + if command -v kind >/dev/null 2>&1; then + for cluster in $(kind get clusters 2>/dev/null); do + kind export logs "$DEBUG_OUTPUT_DIR/$cluster" --name "$cluster" || true + done + fi + if command -v kubectl >/dev/null 2>&1; then + kubectl get all -A -o wide > "$DEBUG_OUTPUT_DIR/kubectl-get-all.txt" || true + kubectl get pods -A -o wide > "$DEBUG_OUTPUT_DIR/kubectl-get-pods.txt" || true + kubectl describe pods -A > "$DEBUG_OUTPUT_DIR/kubectl-describe-pods.txt" || true + fi + docker ps -a > "$DEBUG_OUTPUT_DIR/docker-ps.txt" || true + - name: Upload debug output - if: failure() + if: always() uses: actions/upload-artifact@v4 with: name: awx-operator-debug-output path: ${{ env.DEBUG_OUTPUT_DIR }} + - name: Fail awx-operator check if test deployment failed + if: steps.awx_operator_test.outcome != 'success' + run: exit 1 + collection-sanity: name: awx_collection sanity runs-on: ubuntu-latest From 94d5769f32e72e973ae8d410d8fe1d240b960b3e Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Fri, 23 Jan 2026 10:05:44 -0500 Subject: [PATCH 2/2] Fix extremely flaky failure (#16161) --- awxkit/test/test_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/awxkit/test/test_utils.py b/awxkit/test/test_utils.py index 8f9391c857..dc43de42b5 100644 --- a/awxkit/test/test_utils.py +++ b/awxkit/test/test_utils.py @@ -93,7 +93,12 @@ def test_random_titles_generates_correct_characters(non_ascii): title = utils.random_title(non_ascii=non_ascii) if non_ascii: with pytest.raises(UnicodeEncodeError): - title.encode('ascii') + # There is a tiny (flaky) chance that random_title will just happen + # to generate unicode that is also valid ascii + # so we repeat a few times, just to be sure we get non-ascii + for i in range(4): + title = utils.random_title(non_ascii=non_ascii) + title.encode('ascii') title.encode('utf-8') else: title.encode('ascii')