There are fears of a shortage of coronavirus tests as people rush to get symptoms checked in Caerphilly county, GPs have said.
The county is being placed in lockdown from 18:00 BST on Tuesday, following a spike in cases.
The British Medical Association (BMA) said the queues at the pop-up test centre in the town were "horrific".
Health Minister Vaughan Gething said testing had picked up the levels of community transmission.
But he acknowledged a UK-wide testing programme was facing challenges in coping with demand.
Chief executive of Caerphilly council, Christina Harrhy, urged people to only get tested if they were showing symptoms.
Dr David Bailey, chairman of the British Medical Association (BMA) in Wales and a GP in Caerphilly, said: "The queues at the pop-up centre in Caerphilly yesterday were horrific, although we understand people were all getting tested.
"The capacity seems to be struggling across the UK, and people being sent across the country is hardly helpful with keeping people local and staying socially distanced."
Caerphilly county has had more new cases in the past week - 98 - than anywhere else in Wales and more than the area has seen since the end of April.
Community testing started in the county at the weekend, a total of 450 people were tested and 19 were positive for Covid-19.
In Bridgend county, people spoke of trying to book a test at a drive-through centre or a mobile unit via a UK online system, but being told their nearest available slot was at Bristol Airport, more than 60 miles away.
While Andy, from Caerphilly, said he was unable to get a test for his two sons after they developed a cough.
"My partner took them down to the testing site at the leisure centre, but there was a three-hour queue. That was at 8am.
"She was told to go up to the new centre up in Penallta. She made her way up there, and there were already hundreds of cars.
"She was waiting in the queue and she was told at that point that if she didn't have ID for the children they couldn't be tested - how are you going to have ID for children with you?"
Shehzad Malik, from Cardiff, also had problems while trying to get a test for his parents.
He said his mother was advised to get a test by her GP after developing a chest infection, but after hours of struggling with the system, was offered a test more than an hour's drive west of Cardiff.
He said: "Yesterday I tried several times to book a drive-through test at my nearest test centre but to no avail.
"Once I had found the correct link I filled in the relevant information and each time I tried submitting the information online the page would not load to offer me a test.
"I kept trying online to get an appointment, almost every half hour from 2pm to 10pm, and the site kept crashing.
"Eventually, at about 22:15, I was able to upload all the information and was offered a Covid test in Carmarthen, 55 miles from my home in Cardiff."
In Gwynedd, GPs spoke of patients being sent miles to get tested after being concerned about symptoms, including shortness of breath, persistent coughs, and high temperatures.
Dr Huw Gwilym, who was on call at the Waunfawr surgery, said: "There are examples of patients in Waunfawr being offered tests in Telford [125 miles], Oswestry [67 miles] and Aberystwyth [70 miles]," he said.
"We are very concerned about the situation because it is unfair to ask people with Covid-19 symptoms, who are ill and should self-isolate, to travel for hours by car to get a test. We didn't expect such problems months into the pandemic."
Dr Eilir Hughes, a GP in Nefyn, Gwynedd, said he was concerned people were being "put off" going to get tested due to being asked to travel miles from their homes.
"There are several reports that people are being offered a test in Manchester [125 miles] or Aberystwyth [75 miles] whilst they live here on the Llŷn Peninsula," he said.
"The truth is the nearest TTP testing centre is Llandudno [55 miles] which in itself is too far. People then request home tests and they are told they've ran out of stock.
UK testing programme faces 'challenges'
Mr Gething said there were "challenges" about the way the UK-wide Lighthouse testing labs were running "and its ability to cope with demand".
In the most recent week for which figures are available 9,904 tests were processed in NHS Wales labs, while 26,067 were sent to Lighthouse labs.
He said: "These are issues that my team have been raising through official levels. And I'm hoping to speak to other health ministers across the UK within the next day or two if possible - we sought a meeting today with colleagues in Northern Ireland as well - to be able to run through what is actually happening.
"None of us want to see people being asked to travel large distances which for some people won't be possible."
Mr Gething said mobile testing in Caerphilly had seen a large number of people attending.
That allowed the Welsh Government "to pick up the levels of community transmission from people outside the clusters we've already been able to identify", he said.
A spokesman added: "We have raised this issue with the UK government, which runs the Lighthouse Lab testing system and we expect these issues to be resolved quickly to ensure people in Wales who have suspected coronavirus symptoms can receive a test as close to home as possible.
"We have recently announced £32m to increase capacity to process tests at laboratories in Wales, which includes extending our regional labs to 24-hour operation and six new 'hot labs' at hospitals across Wales. This investment will increase our testing resilience ahead of the winter."