At the club I hang out at three days a week we have a pretty constant flow of powder guys no longer use or donate. Funds go toward range development. Most of the cans are opened and unless I know the guy I won't touch them. Unopened cans that show no signs of ever being exposed to moisture are a safe bet. Any signs of rust other than lightly on surface and I'm out. Black powder can even get wet and once dried again appears none the worse for wear, getting wet is part of its manufacturing process. I have received 25lb kegs of black powder that had powder clumped into balls, crushed them in my hands and away we went. I had an old buddy that used to take every can of black powder that came his way and run it through granulation screens. He claimed in every can of 2F powder there a bit of 3F and even some 4F. He was one of those guys I refer to as an inveterate tinkerer, he could not leave well enough alone. Get a rifle shooting dead nuts on and change something, always chasing the perfect combination. His motto was "If you haven't tried it, you'll never know." That might be true when it comes to Menudo but some stuff is best left as is.
I read somewhere that some archeologists found a cannon that was sealed before the boat sank, the muzzle had a tompion firmly in place and breech was sealed. They were curious about the air that was inside the barrel and drilled a tiny hole allowing them to retrieve the air that had been inside the cannon since the 1700's. Not only did they get a good sample of dry air but also found that the black powder was still viable and would have been capable of firing the shot that was loaded.
I have never loaded a cartridge with powder that when it failed to fire was due to bad powder. I have learned valuable lessons while learning to reload such as never rush the process. I have gone from freshly cleaned cartridges that had been sonic cleaned to reloaded without enough time to adequately remove any possible moisture, primer failures and contamination from dirty fingers, mostly oils. Primers can go bad, some black powder caps use fulminate of mercury and are the best for reliability. I have had cartridge primers that I can fart louder than, usually trying to save a few bucks like using pre-primed cartridges some old buddy gave me that could go back to the 50's and 60's. I gave up on most of that stuff after having fail to fires and now make sure I am wearing full shields when I punch those live primers out, never had an issue but you never know.