DICE-UNC/metalnx-web

ticket tests failing when run together, possible iRODS issue

Opened this issue · 2 comments

this is a pointer to an error filed under Jargon...

DICE-UNC/jargon#266

involving the tests in here (services)

package com.emc.metalnx.services.tests.tickets;

import static junit.framework.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.List;

import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.ticket.packinstr.TicketCreateModeEnum;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import com.emc.metalnx.core.domain.exceptions.DataGridConnectionRefusedException;
import com.emc.metalnx.core.domain.exceptions.DataGridException;
import com.emc.metalnx.services.interfaces.IRODSServices;
import com.emc.metalnx.services.interfaces.TicketService;

/**
 * Test iRODS services.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:test-services-context.xml")
@WebAppConfiguration
public class TestDeleteTickets {
	@Value("${irods.zoneName}")
	private String zone;

	@Value("${jobs.irods.username}")
	private String username;

	@Autowired
	private TicketService ticketService;

	@Autowired
	private IRODSServices irodsServices;

	private TestTicketUtils ticketUtils;
	private List<String> ticketStrings;

	@Before
	public void setUp() throws DataGridException, JargonException {
		String parentPath = String.format("/%s/home", zone);
		ticketUtils = new TestTicketUtils(irodsServices);
		ticketStrings = new ArrayList<>();
		ticketStrings.add(ticketUtils.createTicket(parentPath, username));
		ticketStrings.add(ticketUtils.createTicket(parentPath, username, TicketCreateModeEnum.WRITE));
	}

	@After
	public void tearDown() throws DataGridConnectionRefusedException, JargonException {
		ticketUtils.deleteAllTicketsForThisUser();
	}

	@Test
	public void testBulkDelete() throws DataGridConnectionRefusedException, JargonException {
		ticketService.bulkDelete(ticketStrings);
		assertTrue(ticketUtils.listAllTicketsForUser().isEmpty());
	}

etc.

They seem to fail when run together with underlying ODBC foo

nb addition of 'close()' in the before of the connections now limits the errors to the test

@Test
	public void testBulkDelete() throws DataGridConnectionRefusedException, JargonException {
		ticketService.bulkDelete(ticketStrings);
		assertTrue(ticketUtils.listAllTicketsForUser().isEmpty());
	}

This will be ignored for now and delegated to jargon/iRODS testing and opened back up when resolved

NB several ticket tests moved into attic for services temporarily, pending a general review of ticket support and cleanup.