How long does gasoline last in a car tank is usually three to six months. In a sealed container it often lasts 6-12 months. https://www.elanfuels.com/how-long-does-gasoline-last-fuel-tank-storage-stable-time-stay-ethanol-petrol/
ExxonMobil states, "In general, the recommended shelf life for oils and greases is typically five years when stored properly in the original sealed containers." - Drums of oil do not contain anything that goes bad in the way food does. However, oil can be degraded due to contaminants and/or additive dropout because of mishandling. https://petroleumservicecompany.com/blog/what-is-the-shelf-life-of-oil-ins-and-outs-of-oil-storage/