我是 k6 的第一次用户,在运行脚本时我已经设法得到一个错误:
"请求失败 [33merror[0m="Get https:///: 在 0 次重定向后停止"
脚本 k6.js:
import http from "k6/http";
import { sleep } from "k6";
export let options = {
stages: [
{ duration: "30s", target: 20 },
{ duration: "1m30s", target: 10 },
{ duration: "20s", target: 0 },
]
};
export default function() {
let res = http.get("https://<our_page_URL>/");
check(res, {
"status code MUST be 200": (res) => res.status == 200,
}) || fail("status code was *not* 200");
sleep(1);
}
为什么我会收到此错误,解决方案是什么?