There are many ways in which cancer can cause fatigue. The growth of a tumor, in general, can be taxing for your body. Other symptoms of cancer such as shortness of breath, anemia, pain, or a decreased level of oxygen in your blood (hypoxia) can cause fatigue.
A pulmonary function test may take 30 to 60 minutes to complete. This will vary according to the amount of trials necessary for you to get repeatable test results.
Work with good doctors and they will eventually get you back to good health. It may take a long time (3+ years for me), but it is possible. Also, pulmonary function tests can be a little miss leading. The numbers are based on 'norms'.