From locking in workers to hoarding medicines, beds and disinfectant, China’s factories are going to great lengths to keep the machines running — and the global supply chain intact — as an onslaught of COVID-19 cases looms.

The world’s second-biggest economy is rapidly dismantling restrictions that largely kept the virus at bay for almost three years. The resulting eruption in infections is set to be a key test for a vast network of factories that account for almost one-third of the world’s manufacturing output. Those plants are now taking extraordinary steps to ward off infections.

Sinopec, for example, likens the task ahead to fighting a war. The Chinese oil refining giant has gone over plans to hold output steady, isolating certain employees from the rest of the workforce and scrapping leave. Electric vehicle maker Nio has secured several truckloads of medical supplies and equipment for staff as part of a plan to keep its lines humming.