# Different Errors on CI and local machine

**URL:** https://discourse.julialang.org/t/different-errors-on-ci-and-local-machine/83120
**Category:** Internals & Design
**Tags:** error, github, ci
**Created:** [June 21, 2022, 12:37pm UTC](https://discourse.julialang.org/t/different-errors-on-ci-and-local-machine/83120 "2022-06-21T12:37:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fbanning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fbanning/32/14972_2.png) [@fbanning](https://discourse.julialang.org/u/fbanning)
#### Post date: [June 21, 2022, 12:37pm UTC](https://discourse.julialang.org/t/different-errors-on-ci-and-local-machine/83120/1 "2022-06-21T12:37:19Z")

</div>

I’m encountering an issue with CI on github. If I define

```julia
julia> foo(x) = nothing 
foo (generic function with 1 method)

```

and do a `@test_throws` with it, I would expect it to throw a `MethodError` like here

```julia
julia> foo(; x = 1)
ERROR: MethodError: no method matching foo(; x=1)
Closest candidates are:
  foo(::Any) at REPL[1]:1 got unsupported keyword argument "x"
Stacktrace:
 [1] top-level scope
   @ REPL[4]

```

but it seems to throw an `ArgumentError` instead.  
The same issue happens for 1.6.6 and 1.7.3 on CI (throws `ArgumentError` instead of `MethodError`). On my local machine running 1.7.3 it always throws a `MethodError`.

At the current stage, I would consider this a bug but I’m at a complete loss about why it’s happening. Any ideas from the community about what might be the issue here?

In the meantime I’ve worked around it with

```julia
if get(ENV, "CI", nothing) == "true"
    @test_throws ArgumentError foo(; x=1)
else
    @test_throws MethodError foo(; x=1)
end

```

and while it’s nice and explicit about the source of the problem (i.e. the CI environment), it’s not really a long-term solution for the problem.

Thanks in advance and best wishes

---

<div class="post-metadata">

### Author: ![fbanning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fbanning/32/14972_2.png) [@fbanning](https://discourse.julialang.org/u/fbanning)
#### Post date: [June 21, 2022, 3:23pm UTC](https://discourse.julialang.org/t/different-errors-on-ci-and-local-machine/83120/2 "2022-06-21T15:23:33Z")

</div>

Since somebody asked for the CI logs over on Slack, [this is one of them](https://github.com/fbanning/OSMMakie.jl/runs/6810695245?check_suite_focus=true#step:6:281) where the bug still happened (before I’ve added the CI ENV workaround described above). There isn’t much too see in there to be quite honest. The test that failed looked almost exactly like the one from the previous post.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [June 21, 2022, 3:32pm UTC](https://discourse.julialang.org/t/different-errors-on-ci-and-local-machine/83120/3 "2022-06-21T15:32:18Z")

</div>

To debug issues in GitHub Actions: [GitHub - mxschmitt/action-tmate: Debug your GitHub Actions via SSH by using tmate to get access to the runner system itself.](https://github.com/mxschmitt/action-tmate)

---

<div class="post-metadata">

### Author: ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)
#### Post date: [June 22, 2022, 6:22am UTC](https://discourse.julialang.org/t/different-errors-on-ci-and-local-machine/83120/4 "2022-06-22T06:22:13Z")

</div>

It is the same error locally and on CI (`ArgumentError`). I think the example posted above (with `foo`) is not what is run on CI. On CI and locally the `foo` example gives a `MethodError` for me. If this was not the case for you, could you please provide the CI log where the `foo` example yields an `ArgumentError`?

I think what is happening is that the module defines a method

```julia
osmplot(...; args...)

```

thus slurping all the keyword arguments. In the test, there is the call

```julia
@test_throws ... osmplot(;osm)

```

which is lowered to

```julia
osmplot(;osm = osm)

```

Since there is an `osm` variable bound, this is passed on as a keyword argument, but the `osmplot` function is not able to handle it, throwing an `ArgumentError`.
