A Court of Queen’s Bench judge granted the injunction last December, pending an arbitration hearing, after the union representing about 3,000 oilsands workers in the region requested one.

“We are not persuaded of any reviewable error in the chambers judge’s exercise of discretion,” said the Appeal court decision released Wednesday.

Suncor and Unifor Local 707-A have been battling over random testing since 2012, when the company announced it was going to start the practise. The union argues that it violates workers’ rights and privacy.

That same year, the union was granted its first injunction pending an arbitration hearing into a grievance about the testing.

Arbitration has basically been ongoing ever since. A judicial review set aside an arbitration award and ordered a hearing before a new panel. The Appeal Court previously upheld that ruling.

The union is now waiting to hear whether the Supreme Court of Canada will weigh in on the case.

“It will set precedent for sure if we’re able to get there,” said Ken Smith, president of Unifor Local 707-A.

He called Wednesday’s ruling a small victory.

“It’s one more legal hurdle that we’ve gotten by and it’s one more panel that has upheld the decision that this strikes at the dignity and respect of workers,” Smith said.

The Appeal ruling said the crux of the case is balancing safety against privacy interests.

Two judges noted that while there is clearly a safety issue, random testing would target about 1,339 employees per year or 104 per month.

“It is therefore conceivable that some union employees would be forced to comply with multiple tests within the same month … constituting a significant intrusion on their privacy, dignity and bodily integrity.”

Justice Frans Slater wrote in his dissenting opinion that Suncor’s “concerns about substance abuse are not just hypothetical.”

Some workers have tested positive for drugs including cocaine and opiates, he said, and security officers have not only discovered drugs but also fake urine, urine tampering devices and weapons.

Slater said he would have allowed Suncor’s appeal and set aside the injunction.

Suncor spokeswoman Sneh Seetal said the company is reviewing the Appeal decision and assessing its options. It has been trying to address safety concerns posed by drugs and alcohol over the last 20 years, she said, but no other measures have appropriately mitigated the risk.

“We care about the people at our site. We want to ensure we send folks home at the end of their shift,” Seetal said.

“We wouldn’t be pursuing this if we didn’t feel it was absolutely necessary.”