Rayrun
← Back to Discord Forum

Playwright crash , test was killed

guillaumecamusposted in #help-playwright
Open in Discord
guillaumecamus
guillaumecamus

Hello, I created a project playwright from scrash with the command: npm init playwright@latest I've versioned in git, and I'm trying to run it with in kubernetes in a pod. I do:

export CI=1
npm ci
npx playwright test

and I have this output:

root@64c39590357ffbe7d162ee0f-cdnvc:/data/repo# npx playwright test
^[[3~
Running 2 tests using 1 worker

     1 [chromium] › example.spec.ts:3:5 › has title
Killed

My pod is started with the image docker pull mcr.microsoft.com/playwright:focal On my local env, the project works correctly, but I don't understand what's missing. Can you help me?

This thread is trying to answer question "Why is the Playwright test getting killed when run in a Kubernetes pod?"

8 replies

What kind of resources are you making available to your docker image? Sounds like they might be on the low side of things

CPU and Memory, I mean

edouard-lopez
edouard-lopez

from inside the container I got

root@64c39590357ffbe7d162ee0f-cdnvc:/# cat /sys/fs/cgroup/cpu/cpuacct.usage
89837602027
root@64c39590357ffbe7d162ee0f-cdnvc:/# cat /sys/fs/cgroup/memory/memory.usage_in_bytes
4943872
root@64c39590357ffbe7d162ee0f-cdnvc:/# cat /sys/fs/cgroup/memory/memory.usage_in_bytes | numfmt --to=iec
5.0M
root@64c39590357ffbe7d162ee0f-cdnvc:/# cat /sys/fs/cgroup/cpu/cpuacct.usage | numfmt --to=iec
84G
edouard-lopez
edouard-lopez
❯ kubectl top pod 64c39590357ffbe7d162ee0f-cdnvc -n qraft --containers
POD                              NAME                       CPU(cores)   MEMORY(bytes)   
64c39590357ffbe7d162ee0f-cdnvc   64c39590357ffbe7d162ee0f   0m           3Mi

that's super low if I understand kubernetes syntax correctly

if you will be running with one worker then you should set requests for pod cpu to 2000m and memory like 4Gi

guillaumecamus
guillaumecamus

Oh yes , that fix the issue! thank

I strongly recommend you to use a versioned Docker container: https://playwright.dev/docs/docker

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].