Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post Setup JDK 17 takes very long time on local runner #683

Closed
3 tasks
MartynasObdeleven opened this issue Sep 11, 2024 · 8 comments
Closed
3 tasks

Post Setup JDK 17 takes very long time on local runner #683

MartynasObdeleven opened this issue Sep 11, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@MartynasObdeleven
Copy link

Description:
I have a build script that is run on each PR. It launches appium test suite, which takes approximately 4 minutes to complete,
but after that Post Setup JDK 17 takes more than 10 minutes which is strange, since we're using m1 mac studio.
Job looks like:

name: Appium Tests

on:
  push:
    branches:
      - "develop"
  pull_request:
    branches:
      - "main"
      - "develop"

jobs:
  appium-tests:
    runs-on: [self-hosted, macOS, ARM64]

    steps:
      - uses: actions/[email protected]

      - name: Set up JDK 17
        uses: actions/[email protected]
        with:
          java-version: '17'
          distribution: 'zulu'
          cache: gradle

      - name: Grant execute permission for gradlew
        run: chmod +x gradlew

      - name: Appium Tests (E2E)
        run: |
          chmod +x run_offline_appium_tests.sh
          ./run_offline_appium_tests.sh
        working-directory: scripts

Here's timeline:
image

Task version:
4.3.0

Platform:

  • Ubuntu
  • [x ] macOS
  • Windows

Runner type:

  • Hosted
  • [ x] Self-hosted

Expected behavior:
Post Setup takes no more than minute.

Actual behavior:
Post Setup takes 10+ minutes.

@MartynasObdeleven MartynasObdeleven added bug Something isn't working needs triage labels Sep 11, 2024
@aparnajyothi-y
Copy link
Contributor

Hello @MartynasObdeleven, Thank you for creating this issue and we will look into it :)

@choppeh
Copy link

choppeh commented Sep 16, 2024

v3 is also very slow with JDK 17. Is the cache size Ok?

@choppeh
Copy link

choppeh commented Sep 16, 2024

I removed cache: gradle and the step was quickly completed

@MartynasObdeleven
Copy link
Author

I had setup java on local machine so it runs fine with:

name: Appium Tests

on:
  push:
    branches:
      - "develop"
  pull_request:
    branches:
      - "main"
      - "develop"

jobs:
  appium-tests:
    runs-on: [self-hosted, macOS, ARM64]

    steps:
      - uses: actions/[email protected]

      - name: Grant execute permission for gradlew
        run: chmod +x gradlew

      - name: Appium Tests (E2E)
        run: |
          chmod +x run_offline_appium_tests.sh
          ./run_offline_appium_tests.sh
        working-directory: scripts

@mahalakshmi-rekadi
Copy link

Hello @MartynasObdeleven,
Thank you for bringing this issue to our attention. It appears that the post-setup step for JDK 17 is taking an unusually long time, even though the Appium test suite completes in about 4 minutes. Here are a few points to consider:

1.It looks like the cache size in your workflow is around 6GB (~6353 MB). This could be the reason why the "Post Setup JDK 17" step is taking more than 10 minutes to complete, especially since you're using an M1 Mac Studio, which should be quite fast.

2.To verify if the cache is causing the delay, I recommend running the same workflow without caching. You can do this by removing the cache configuration from the actions/setup-java step. This will help determine if the cache is indeed the factor slowing down the process. If the steps complete more quickly without the cache, you may need to optimize the caching strategy.

If the issue persists, kindly provide us with more detailed logs or a public repository to facilitate further investigation.

@srinivasboga
Copy link

srinivasboga commented Sep 22, 2024

Hello @MartynasObdeleven, @mahalakshmi-rekadi @choppeh,

I've also encountered this issue with the "Post Setup JDK 17" step taking a long time due to the large cache size (~6GB). After removing the cache: gradle configuration, the step completed much faster.

I'll try optimizing the cache, but removing it completely for now seems to be the best workaround.

My Recommendation

  1. Remove Cache: As suggested by @choppeh, removing the cache: gradle from the setup-java step might solve the problem. It was reported to significantly reduce the time for the "Post Setup JDK 17" step.

    `

  • name: Set up JDK 17
    uses: actions/[email protected]
    with:
    java-version: '17'
    distribution: 'zulu'

    cache: gradle # <--- Try commenting this out

`

  1. Cache Optimization: If removing the cache resolves the issue, you might need to revise the caching strategy. Perhaps only caching essential Gradle directories or reducing the frequency of cache uploads could help without removing the cache entirely.

Further Steps:

  1. Run the Workflow without Cache: Test the workflow by removing the cache configuration as suggested to see if it resolves the delay in the post-setup step.

  2. Provide Detailed Logs: If the issue persists, consider sharing more detailed logs or a sample public repository with the maintainers to help further investigate the root cause.

@mahalakshmi-rekadi
Copy link

Hello @MartynasObdeleven, We are awaiting for your response on the issue. Please let us know if we can close this issue if there are no further queries.

@mahalakshmi-rekadi
Copy link

Hello @MartynasObdeleven,
Due to inactivity i'm going to close this issue for now .Please feel free to reopen this issue or create a new one if necessary.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants