From 778b309ff44471939fe5292e1cc12bed9603dd1e Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 15 May 2024 12:53:26 +0800 Subject: [PATCH 1/7] ci: disable other test --- .github/workflows/nightly-ci.yml | 102 +++++++++++++++---------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 1665d9547264..8b22183ea4b7 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -1,6 +1,6 @@ on: schedule: - - cron: '0 23 * * 1-5' + - cron: "0 23 * * 1-5" workflow_dispatch: name: Nightly CI @@ -13,57 +13,57 @@ env: RUST_TOOLCHAIN: nightly-2024-04-20 jobs: - sqlness-test: - name: Run sqlness test - if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 + # sqlness-test: + # name: Run sqlness test + # if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 - - name: Run sqlness test - uses: ./.github/actions/sqlness-test - with: - data-root: sqlness-test - aws-ci-test-bucket: ${{ vars.AWS_CI_TEST_BUCKET }} - aws-region: ${{ vars.AWS_CI_TEST_BUCKET_REGION }} - aws-access-key-id: ${{ secrets.AWS_CI_TEST_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_CI_TEST_SECRET_ACCESS_KEY }} + # - name: Run sqlness test + # uses: ./.github/actions/sqlness-test + # with: + # data-root: sqlness-test + # aws-ci-test-bucket: ${{ vars.AWS_CI_TEST_BUCKET }} + # aws-region: ${{ vars.AWS_CI_TEST_BUCKET_REGION }} + # aws-access-key-id: ${{ secrets.AWS_CI_TEST_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_CI_TEST_SECRET_ACCESS_KEY }} - sqlness-windows: - name: Sqlness tests on Windows - if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} - runs-on: windows-2022-8-cores - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - - uses: arduino/setup-protoc@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Run sqlness - run: cargo sqlness - - name: Notify slack if failed - if: failure() - uses: slackapi/slack-github-action@v1.23.0 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DEVELOP_CHANNEL }} - with: - payload: | - {"text": "Nightly CI failed for sqlness tests"} - - name: Upload sqlness logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: sqlness-logs - path: /tmp/greptime-*.log - retention-days: 3 + # sqlness-windows: + # name: Sqlness tests on Windows + # if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} + # runs-on: windows-2022-8-cores + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v4 + # - uses: arduino/setup-protoc@v3 + # with: + # repo-token: ${{ secrets.GITHUB_TOKEN }} + # - uses: dtolnay/rust-toolchain@master + # with: + # toolchain: ${{ env.RUST_TOOLCHAIN }} + # - name: Rust Cache + # uses: Swatinem/rust-cache@v2 + # - name: Run sqlness + # run: cargo sqlness + # - name: Notify slack if failed + # if: failure() + # uses: slackapi/slack-github-action@v1.23.0 + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DEVELOP_CHANNEL }} + # with: + # payload: | + # {"text": "Nightly CI failed for sqlness tests"} + # - name: Upload sqlness logs + # if: always() + # uses: actions/upload-artifact@v4 + # with: + # name: sqlness-logs + # path: /tmp/greptime-*.log + # retention-days: 3 test-on-windows: name: Run tests on Windows @@ -88,7 +88,7 @@ jobs: - name: Install Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: "3.10" - name: Install PyArrow Package run: pip install pyarrow - name: Install WSL distribution From ac3895345b67885ea4e35e163bda792378815725 Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 15 May 2024 13:20:28 +0800 Subject: [PATCH 2/7] ci: timeout 30 --- .github/workflows/nightly-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 8b22183ea4b7..9c6f0f69b3a3 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -69,7 +69,7 @@ jobs: name: Run tests on Windows if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} runs-on: windows-2022-8-cores - timeout-minutes: 60 + timeout-minutes: 30 steps: - run: git config --global core.autocrlf false - uses: actions/checkout@v4 From 48949b542da29b09db41d3b035a49c5f319bc881 Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 15 May 2024 14:41:37 +0800 Subject: [PATCH 3/7] ci: try to use lld --- .github/workflows/nightly-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 9c6f0f69b3a3..fb7c85648be0 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -76,6 +76,9 @@ jobs: - uses: arduino/setup-protoc@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: KyleMayes/install-llvm-action@v1 + with: + version: "14.0" - name: Install Rust toolchain uses: dtolnay/rust-toolchain@master with: @@ -98,6 +101,7 @@ jobs: - name: Running tests run: cargo nextest run -F pyo3_backend,dashboard env: + CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=lld" RUST_BACKTRACE: 1 CARGO_INCREMENTAL: 0 GT_S3_BUCKET: ${{ vars.AWS_CI_TEST_BUCKET }} From 7a740a73cc7cef6734faaf37ee1c2eaca0067ba1 Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 15 May 2024 15:43:49 +0800 Subject: [PATCH 4/7] ci: change linker --- .github/workflows/nightly-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index fb7c85648be0..96766cc548f0 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -101,7 +101,7 @@ jobs: - name: Running tests run: cargo nextest run -F pyo3_backend,dashboard env: - CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=lld" + CARGO_BUILD_RUSTFLAGS: "-C linker=lld-link" RUST_BACKTRACE: 1 CARGO_INCREMENTAL: 0 GT_S3_BUCKET: ${{ vars.AWS_CI_TEST_BUCKET }} From 06d4d2880b79e4ec2e2bdac029a73b5cceaf8b4c Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 15 May 2024 16:22:47 +0800 Subject: [PATCH 5/7] test: wait for file change in test multiple times --- src/servers/src/tls.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/servers/src/tls.rs b/src/servers/src/tls.rs index 2055081012ca..c7c33328c221 100644 --- a/src/servers/src/tls.rs +++ b/src/servers/src/tls.rs @@ -425,7 +425,12 @@ mod tests { .expect("failed to copy key to tmpdir"); // waiting for async load - std::thread::sleep(std::time::Duration::from_millis(300)); + for _ in 0..3 { + std::thread::sleep(std::time::Duration::from_millis(300)); + if server_config.get_version() > 1 { + break; + } + } assert!(server_config.get_version() > 1); assert!(server_config.get_server_config().is_some()); } From 1a6787c1e619f175068bf66af98dd58de43daedb Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 15 May 2024 16:23:15 +0800 Subject: [PATCH 6/7] ci: enable other tests --- .github/workflows/nightly-ci.yml | 100 +++++++++++++++---------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 96766cc548f0..d0eb2aedc72e 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -13,63 +13,63 @@ env: RUST_TOOLCHAIN: nightly-2024-04-20 jobs: - # sqlness-test: - # name: Run sqlness test - # if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} - # runs-on: ubuntu-22.04 - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 + sqlness-test: + name: Run sqlness test + if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 - # - name: Run sqlness test - # uses: ./.github/actions/sqlness-test - # with: - # data-root: sqlness-test - # aws-ci-test-bucket: ${{ vars.AWS_CI_TEST_BUCKET }} - # aws-region: ${{ vars.AWS_CI_TEST_BUCKET_REGION }} - # aws-access-key-id: ${{ secrets.AWS_CI_TEST_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_CI_TEST_SECRET_ACCESS_KEY }} + - name: Run sqlness test + uses: ./.github/actions/sqlness-test + with: + data-root: sqlness-test + aws-ci-test-bucket: ${{ vars.AWS_CI_TEST_BUCKET }} + aws-region: ${{ vars.AWS_CI_TEST_BUCKET_REGION }} + aws-access-key-id: ${{ secrets.AWS_CI_TEST_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_CI_TEST_SECRET_ACCESS_KEY }} - # sqlness-windows: - # name: Sqlness tests on Windows - # if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} - # runs-on: windows-2022-8-cores - # timeout-minutes: 60 - # steps: - # - uses: actions/checkout@v4 - # - uses: arduino/setup-protoc@v3 - # with: - # repo-token: ${{ secrets.GITHUB_TOKEN }} - # - uses: dtolnay/rust-toolchain@master - # with: - # toolchain: ${{ env.RUST_TOOLCHAIN }} - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # - name: Run sqlness - # run: cargo sqlness - # - name: Notify slack if failed - # if: failure() - # uses: slackapi/slack-github-action@v1.23.0 - # env: - # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DEVELOP_CHANNEL }} - # with: - # payload: | - # {"text": "Nightly CI failed for sqlness tests"} - # - name: Upload sqlness logs - # if: always() - # uses: actions/upload-artifact@v4 - # with: - # name: sqlness-logs - # path: /tmp/greptime-*.log - # retention-days: 3 + sqlness-windows: + name: Sqlness tests on Windows + if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} + runs-on: windows-2022-8-cores + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-protoc@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Run sqlness + run: cargo sqlness + - name: Notify slack if failed + if: failure() + uses: slackapi/slack-github-action@v1.23.0 + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DEVELOP_CHANNEL }} + with: + payload: | + {"text": "Nightly CI failed for sqlness tests"} + - name: Upload sqlness logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: sqlness-logs + path: /tmp/greptime-*.log + retention-days: 3 test-on-windows: name: Run tests on Windows if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} runs-on: windows-2022-8-cores - timeout-minutes: 30 + timeout-minutes: 60 steps: - run: git config --global core.autocrlf false - uses: actions/checkout@v4 From c9a942d77b02b7a7947fc57cac3cdeec8e95944b Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 15 May 2024 17:06:22 +0800 Subject: [PATCH 7/7] chore: revert sleep in loop --- src/servers/src/tls.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/servers/src/tls.rs b/src/servers/src/tls.rs index c7c33328c221..9a3082b46c7e 100644 --- a/src/servers/src/tls.rs +++ b/src/servers/src/tls.rs @@ -391,6 +391,8 @@ mod tests { #[test] fn test_tls_file_change_watch() { + common_telemetry::init_default_ut_logging(); + let dir = tempfile::tempdir().unwrap(); let cert_path = dir.path().join("serevr.crt"); let key_path = dir.path().join("server.key"); @@ -425,12 +427,7 @@ mod tests { .expect("failed to copy key to tmpdir"); // waiting for async load - for _ in 0..3 { - std::thread::sleep(std::time::Duration::from_millis(300)); - if server_config.get_version() > 1 { - break; - } - } + std::thread::sleep(std::time::Duration::from_millis(300)); assert!(server_config.get_version() > 1); assert!(server_config.get_server_config().is_some()); }