Skip to content
This repository was archived by the owner on Jun 5, 2026. It is now read-only.
This repository was archived by the owner on Jun 5, 2026. It is now read-only.

Unable to exit / terminate CI #22

Description

@poponuts

I used the default yaml file to run load tests via CI (Note: This works fine when running on my local machine):

name: Main Workflow
on: [push]
jobs:
  build:
    name: Run k6 test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Run k6 local test
        uses: grafana/k6-action@v0.3.1
        with:
          filename: api/test.js
          flags: --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';
import http from 'k6/http';

// parameterise environment-specific variables
const env = JSON.parse(open(`../config/${__ENV.HOST}.env.json`))
const baseUrl = env.baseUrl;
const accessToken = env.accessToken;

const query = 'query Session { user { id } }';
const headers = {
  'x-access-token': accessToken,
  'content-type': 'application/json',
};

export default function main() {
  group('session test', function () {
    const res = 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
    });
  })
};

config/staging.env.json

{
    "baseUrl": "https://my-test-site.com",
    "accessToken": "some-valid-token"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions