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

Building on MacOS is flaky #307

Open
krzema12 opened this issue Dec 17, 2024 · 10 comments
Open

Building on MacOS is flaky #307

krzema12 opened this issue Dec 17, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@krzema12
Copy link
Owner

krzema12 commented Dec 17, 2024

Sometimes, more than less often, build-on-MacOSLatest fails.

Example: https://github.com/krzema12/snakeyaml-engine-kmp/actions/runs/12377077417/job/34545763964

From the logs:

  :jsBrowserTest: java.lang.IllegalStateException: Errors occurred during launch of browser for testing.
For more on this, please refer to https://docs.gradle.org/8.11.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
  - ChromeHeadless
  Please make sure that you have installed browsers.
  Or change it via
  browser {
      testTask {
          useKarma {
              useFirefox()
              useChrome()
              useSafari()
          }
      }
  }

Several commits earlier, it succeeded: https://github.com/krzema12/snakeyaml-engine-kmp/actions/runs/12369132747/job/34520445069

@krzema12 krzema12 added the bug Something isn't working label Dec 17, 2024
@krzema12
Copy link
Owner Author

krzema12 commented Dec 17, 2024

Chrome is available on the runner: https://github.com/actions/runner-images/blob/macos-14-arm64/20241211.616/images/macos/macos-14-arm64-Readme.md#browsers

What's more, it works fine in PRs.

@krzema12 krzema12 self-assigned this Dec 18, 2024
@krzema12
Copy link
Owner Author

We had just a few flakes so far. I'd wait a week or so to see how it behaves.

@krzema12
Copy link
Owner Author

The issue seems to be gone, no sign of it in the last 2 weeks.

@krzema12 krzema12 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2024
@OptimumCode
Copy link
Collaborator

It looks like it reproduced again:
https://github.com/krzema12/snakeyaml-engine-kmp/actions/runs/12687697438/job/35362699974

@krzema12 krzema12 reopened this Jan 9, 2025
@krzema12 krzema12 removed their assignment Jan 9, 2025
@krzema12
Copy link
Owner Author

krzema12 commented Jan 9, 2025

Checking the included software on the worker: https://github.com/actions/runner-images/blob/macos-14-arm64/20250106.725/images/macos/macos-14-arm64-Readme.md

Browsers

  • Safari 18.2 (19620.1.16.111.6)
  • SafariDriver 18.2 (19620.1.16.111.6)
  • Google Chrome 131.0.6778.205
  • Google Chrome for Testing 131.0.6778.204
  • ChromeDriver 131.0.6778.204
  • Selenium server 4.27.0

Environment variables

Name Value
CHROMEWEBDRIVER /usr/local/share/chromedriver-mac-arm64
EDGEWEBDRIVER
GECKOWEBDRIVER

@krzema12
Copy link
Owner Author

krzema12 commented Jan 9, 2025

Asked the community: https://kotlinlang.slack.com/archives/C3PQML5NU/p1736430268539669. Generally starting from Kotlin's side, before asking GitHub for help.

@krzema12 krzema12 self-assigned this Jan 9, 2025
@OptimumCode
Copy link
Collaborator

OptimumCode commented Jan 9, 2025

Looks like this is the cause of the problem:

ChromeHeadless has not captured in 60000 ms, killing.

Maybe for some reason, starting Chrome sometimes takes longer than usual. We can try to increase captureTimeout to see if it solves the problem.

OptimumCode added a commit that referenced this issue Jan 16, 2025
This should help to reduce failures related to the #307 issue.

Also, this change moves karma config to the [correct
location](https://karma-runner.github.io/6.4/config/configuration-file.html)
- it did not have any effect before that
@krzema12
Copy link
Owner Author

@OptimumCode
Copy link
Collaborator

Looks like the configuration was not applied

ChromeHeadless has not captured in 60000 ms, killing.

But it should be 120000 ms now... I will take a look

@OptimumCode
Copy link
Collaborator

Looks like we might need to tweak one more option - browserSocketTimeout. Apperantly, it might also cause error like we see in the logs

krzema12 pushed a commit that referenced this issue Jan 17, 2025
There is one more parameter that can help reduce the chances of getting
error:
> ChromeHeadless has not captured in 60000 ms, killing.

Related to #307
krzema12 pushed a commit that referenced this issue Jan 18, 2025
Last time we had an error during test execution on macOS we saw that the
**captureTimeout** parameter was not applied. This happened because the
content of `karma.config.d/karma.conf.js` file was merged into the
following block:

```js
module.exports = function(config) {
 // kotlin configuration
 // ...
 // content from our file
}
```

As a result, it looked like this:

```js
module.exports = function(config) {
 // kotlin configuration
 // ...
 // content from our file
 module.exports = function(config) {
 }
}
```

That was the reason, why our configuration changes were not applied.
Let's see what happens with #307 issue after we correct the
`karma.conf.js`
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

2 participants