You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the default yaml file to run load tests via CI (Note: This works fine when running on my local machine):
name: Main Workflowon: [push]jobs:
build:
name: Run k6 testruns-on: ubuntu-lateststeps:
- name: Checkoutuses: actions/checkout@v4
- name: Run k6 local testuses: grafana/k6-action@v0.3.1with:
filename: api/test.jsflags: --vus 50 --duration 1m --env HOST=staging --http-debug
However, it doesn't seem to terminate or even a graceful exit. It just continues running.
I added --http-debug to help with the logs but still unable to understand why its not working.
For context, some snippets of my script: api/test.js
import{sleep,group,check}from'k6';importhttpfrom'k6/http';// parameterise environment-specific variablesconstenv=JSON.parse(open(`../config/${__ENV.HOST}.env.json`))constbaseUrl=env.baseUrl;constaccessToken=env.accessToken;constquery='query Session { user { id } }';constheaders={'x-access-token': accessToken,'content-type': 'application/json',};exportdefaultfunctionmain(){group('session test',function(){constres=http.post(`${baseUrl}/_api/graphql`,JSON.stringify({query: query}),{headers: headers,})console.log(`response: ${res.body}`);check(res,{'status is 200': (res)=>res.status===200});})};
I used the default yaml file to run load tests via CI (Note: This works fine when running on my local machine):
However, it doesn't seem to terminate or even a graceful exit. It just continues running.
I added
--http-debugto help with the logs but still unable to understand why its not working.For context, some snippets of my script:
api/test.jsconfig/staging.env.json{ "baseUrl": "https://my-test-site.com", "accessToken": "some-valid-token" }