0

We are trying to run a response time test or fixed test (ramp-up 10 users for 10 seconds and continue the run with 10 users for 30 minutes and then ramp-down the 10 users in the last 10 seconds) using the below code. Here there are 2 unary request calls and one server streaming call. Below code works fine for unary requests but for the server streaming request "appServerStreamScenario" the below error appears. The first few requests are working fine for example in this case-- its taking 15 users so, for each user; one request is being passed and after that for the second request with the same user it starts throwing the below error.

Please advise if there is any other alternative to achieve this scenario where we want to increase the users for some duration post which we want to continue the test with those users for a certain duration and then finally ramp down the users.

Below is the code which we are trying to use-- Code:

val appServerStreamScenario: ScenarioBuilder = scenario("app Server Streaming Flow")
.exec(
  grpc("app_ExecuteCommand_Request").serverStream(AppMessageRouterGrpc.METHOD_EXECUTE_COMMAND, "appServerStreamReplier_" + randomAlphaNumericString(8))
.start(AppMsg(ByteString.EMPTY, Map("commandname"->"printdata")))
.endCheck(statusCode is Status.Code.OK)
)

val session_server_Scenarios =
randomSwitch(
34.0 -> exec(appEchoRequest).pause(5),
33.0 -> exec(appExecuteTransactionRequest).pause(5),
33.0 -> exec(appServerStreamScenario).pause(5)

)

val SessionServerTransactions = scenario("App_Scenarios")
.during(duration, exitASAP = false){
  tryMax(repeats) {
    exec(session_server_Scenarios)
  }.exitHereIfFailed
}

setUp(SessionServerTransactions.inject(rampUsersPerSec(1) to (2) during (10)).protocols(grpcConf.shareChannel))`


[ERROR] c.g.p.g.g.a.ServerStreamStartAction - 'serverStreamStart-9' failed to execute: Unable to create a new server stream with name appServerStreamReplier_YCD4rXyy: already exists ---- Requests ------------------------------------------------------------------

Global (OK=339 KO=0 ) appEchoRequest (OK=183 KO=0 ) appExecuteTransactionRequest (OK=141 KO=0 ) appServerStreamScenario (OK=15 KO=0 ) ---- Errors -------------------------------------------------------------------- appServerStreamScenario: Failed to build request: Unable to 158 (100.0%) create a new server stream with name appServerStreamReplier_YCD4rXyy: already exists

---- App_Scenarios ------------------------------------------------------------- [--------------------------------------------------------------------------] 0% waiting: 0 / active: 15 / done: 0

The expectation here is to run this code without any errors.

VinGt22
  • 21
  • 1

1 Answers1

0

You already have a stream with the same name running. Start another stream with a different streamName, or cancel the already running stream.

George Leung
  • 1,209
  • 1
  • 7
  • 11
  • We have already tried to specify a different stream as below-- appServerStreamReplier_" + randomAlphaNumericString(8) and we have also tried to cancel or pause the existing stream but it still throws the same error. Seems its not able to switch or pick the new name specified – VinGt22 Apr 20 '23 at 23:01
  • Your random is called only once - when the DSL is built. – George Leung Apr 21 '23 at 18:17
  • The serverStreams are getting created as per the number of test users i.e. once per user. Subsequently,for the same user when we call the scenario its unable to create the serverstream and still continues to use the first serverstream name created for that specific user.Here we are trying to run fixed tests where we are seeing this issue. – VinGt22 Apr 25 '23 at 01:45
  • We don't see any issues with the serverstream name during the ramp up period. The issue starts appearing when we expect the load to be stable before finally it ramps down. Thus, in this case possibly random being called is not the issue. Seems we are missing something else here. May be some way to create multiple serverstreams for the same user. – VinGt22 Apr 25 '23 at 01:45