tldr: Tell your SO in advance that you will do a 23andMe on your kid to learn about their predisposition to certain diseases.

If you go on all the relationship subs the people there say the woman should leave the husband immediately if he requests to paternity test the child. Many relationships end over it or are damaged beyond repair. Its usually women online saying this needs to be a hard boundary and its better to be a single mother than let the husband be sure. If you question them they also give a flat 'No.' when you ask if paternity testing should be legally mandatory, and they usually refuse to give a reason or just start attacking you. It is very important to many to keep this option open and not have gender equality in knowing for sure whether your child is really yours.

10% of children have different father to what the child/father is lead to believe according to the best sources we have https://www.telegraph.co.uk/news/2019/05/31/oneperson-10-mistaken-identity-father-reveals-nhs-chief/ . When surveyed men would rather be raped than be cuckolded. Women have the power to remove this evil from the world but too many will vote the other way so its political suicide for politicians to do anything.

So don't ever say you are paternity testing the child. But just give advance warning you will do a 23andme. It gives you plausible deniability. If asked if its about paternity just keep repeating over and over its not about paternity and you trust them 100%. Dont ever say 99%.

You need to do 23andme anyway yourself for this to work. So do it on yourself in advance. Its $99. Then hopefully you will learn things about yourself that are useful like some predisposition to some disease or something. Then that can be your reason for the 23andme test on your future child, which is great reason to get it done anyway.

Warn your partner in advance before pregnancy to lower the risk of her getting pregnant with someone else in the first place. If you are married it doesnt matter and you are going to be paying 18 years child support anyway, but you still have the option to leave her to raise the child with the real father and you can still avoid raising another mans child for 2 decades against your consent by being defrauded by the one you loved and trusted.

Ultimately the odds are you wont be cuckolded, but the consequences of cuckoldry are so severe and the cost of reducing this risk with this method is so small that its irrational not to consider.

I'm sure there are good competitors to 23andme but they are the biggest and most popular so Ive named them. Do your own research.