DICE-UNC / metalnx-web

Metalnx Web Application
https://metalnx.github.io/
Other
1 stars 0 forks source link

ticket tests failing when run together, possible iRODS issue #16

Open michael-conway opened 6 years ago

michael-conway commented 6 years ago

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

https://github.com/DICE-UNC/jargon/issues/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

michael-conway commented 6 years ago

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

michael-conway commented 6 years ago

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