https://linen.dev logo
#general
Title
# general
a

Albert Vesker

04/12/2023, 8:48 AM
Hello. I got flucky test with scenarios I have two stubs with requiredScenarioState and newScenarioState. Some launches I see that wiremock matches first scenario with
"requiredScenarioState": "Started"
What can u suggest me to resolve this problem? Env: Wiremock in docker, stubs load in @BeforeAll once
Copy code
{
  "scenarioName": "11544",
  "requiredScenarioState": "Started",
  "newScenarioState": "SecondRequest",
  "request": {
    "url": "/test",
    "method": "POST"
  },
  "response": {
    "status": 200,
    "jsonBody": {
      "items": []
    },
    "headers": {
      "Content-Type": "application/json"
    }
  }
}
Copy code
{
  "scenarioName": "11544",
  "requiredScenarioState": "SecondRequest",
  "request": {
    "url": "/test",
    "method": "POST"
  },
  "response": {
    "status": 200,
    "jsonBody": {
      "items": [
        {
          "field": "value"
        }
      ]
    },
    "headers": {
      "Content-Type": "application/json"
    }
  }
}
o

Oleg Nenashev

04/12/2023, 11:25 AM
You mean that it responds with the first stub twice?
a

Albert Vesker

04/12/2023, 6:33 PM
Yes
And I have second question: what about logging in project for changing statmenets?
o

Oleg Nenashev

04/12/2023, 9:18 PM
Logging for state changes should be there on INFO level. What do you have configured at the moment?
a

Albert Vesker

04/18/2023, 1:49 PM
--port=52250,--local-response-templating,--verbose,--root-dir=/home/wiremock/storage,--permitted-system-keys=.*
o

Oleg Nenashev

04/18/2023, 6:09 PM
Hard to say right now. Might be a concurrency issue, but it would be a challenge to reproduce it. Maybe you could connect Debugger to WireMock and capture the state of it when this issue happens for your config? Alternatively, if you could create a reproducer GitHub repo, it would be nice too
a

Albert Vesker

04/18/2023, 6:54 PM
1. Tests are not paralleled 2. It happens 1 of 20 pipelines in CI 😞 3. I would like to ask you insert logging about changing scnearioStates in wiremock
o

Oleg Nenashev

04/18/2023, 7:28 PM
It should be there already, but indeed we could add more logging
a

Albert Vesker

04/20/2023, 12:35 PM
It will be really nice!
o

Oleg Nenashev

04/20/2023, 12:38 PM
Could I ask you to create a GitHub issue? I was about creating it on my own but I'm a little bit behind with the community framework. I also created new issue templates and it would be awesome to try them out
a

Albert Vesker

04/20/2023, 12:57 PM
o

Oleg Nenashev

04/20/2023, 1:21 PM
Yep, 👍
2 Views