As an African-American in the 1940ies playing in a mostly white Swing Band, you had to be extremely cool – all eyes from the white audience were you. The performance had clearly to be superior to what the white band colleagues delivered.
What was already very challenging from the outset became extreme when taking the surrounding conditions into account.
When arriving late in the evening in a town after a day of travel, the African-American musician could not check-in to the same hotel as his/her white band members, but had to look for another hotel likely on the outskirts of the town, which accepted “coloured” people (as the expression was then). Eating in the hotel where the show took place was also often not possible. Another example which happened apparently (certainly not only) to Roy Eldrige, when he was playing with Gene Krupta, at times he was not allowed to use the toilet in the venue, a bucket had to do.
All-black ensembles were in no better situation. Many could not survive the Great Depression when a lot of clubs and theatres which catered for African-American audiences closed. The others had to tour all year round through the country to make a living, while the leading white bands stayed in New York, Chicago or another large town and played in the best clubs.
Then was the Jim Crow era, during which facilities and services for African-American and White were strictly separated. While the theory of “separate, but equal” would deliver separated facilities and services but in equal quality, the reality was a stark contrast to the theory. A striking example was the US Army, where black units were separated from white ones, but were led by white officers.
The segregation laws only applied to the Southern states, but in the Northern regions de facto the same situation applied. Only in 1964 these laws were finally abolished.
While Jazz at that time was mainstream and not really a political genre, the Bebop era is more famous for political statements, there were still attempts from leading musicians of that time to improve the situation.
Benny Goodman was apparently the first to make African-American musicians part of his ensemble. In 1935 he hired the pianist Teddy Wilson as a member of his trio. A year later, he added vibraphonist Lionel Hampton to the line-up. This had previously not only being a taboo, but even illegal in some states.
While he certainly wanted to further push the success of his band with these exceptional musicians, these steps nevertheless helped push for racial integration in Jazz.
Duke Ellington was sometimes criticised for not having used his superstar status to push for better conditions for African-American musicians (the same happened to Louis Armstrong). However, he dealt with the issue in a subtle way. For example his contracts always stipulated that he would not play before segregated audiences. But probably the most famous initiative he took was to hire an entire train at some point to tour the South of the US. In the train his musicians and he could sleep, eat and practise without being hassled.
One of the more important figures from the Jazz culture in the fight against racism was the producer John Hammond, who always strived for racial integration within the musical scene. He had not only introduced Benny Goodman and Fletcher Henderson in 1934, Henderson eventually worked for Goodman, but also persuaded Goodman to hire the above mentioned African-American musicians for his ensemble.
Obviously this is by far not an exhaustive list but only a few examples.