Hello. I got flucky test with scenarios I have t...
# general
a
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
You mean that it responds with the first stub twice?
a
Yes
And I have second question: what about logging in project for changing statmenets?
o
Logging for state changes should be there on INFO level. What do you have configured at the moment?
a
--port=52250,--local-response-templating,--verbose,--root-dir=/home/wiremock/storage,--permitted-system-keys=.*
o
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
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
It should be there already, but indeed we could add more logging
a
It will be really nice!
o
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
o
Yep, 👍